forked from mirrors/cbz
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c045c548de | ||
|
|
7355e5edc0 | ||
|
|
5eee972d75 | ||
|
|
3604a4e98f | ||
|
|
19c1b01ea6 |
@@ -10,7 +10,7 @@ jobs:
|
|||||||
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ]
|
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
|
|||||||
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
|
|||||||
|
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [3.4.3] - 2025-08-31
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Bump actions/checkout from 4 to 5.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fix ComicInfo XML parsing for single page comic.
|
||||||
|
|
||||||
## [3.4.2] - 2025-07-26
|
## [3.4.2] - 2025-07-26
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
@@ -205,6 +215,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||||||
|
|
||||||
- Initial release.
|
- Initial release.
|
||||||
|
|
||||||
|
[3.4.3]: https://github.com/hyugogirubato/cbz/releases/tag/v3.4.3
|
||||||
[3.4.2]: https://github.com/hyugogirubato/cbz/releases/tag/v3.4.2
|
[3.4.2]: https://github.com/hyugogirubato/cbz/releases/tag/v3.4.2
|
||||||
[3.4.1]: https://github.com/hyugogirubato/cbz/releases/tag/v3.4.1
|
[3.4.1]: https://github.com/hyugogirubato/cbz/releases/tag/v3.4.1
|
||||||
[3.4.0]: https://github.com/hyugogirubato/cbz/releases/tag/v3.4.0
|
[3.4.0]: https://github.com/hyugogirubato/cbz/releases/tag/v3.4.0
|
||||||
|
|||||||
@@ -220,6 +220,6 @@ This project uses the following third-party libraries:
|
|||||||
- **[rarfile](https://pypi.org/project/rarfile/)** - ISC License
|
- **[rarfile](https://pypi.org/project/rarfile/)** - ISC License
|
||||||
- **[xmltodict](https://pypi.org/project/xmltodict/)** - MIT License
|
- **[xmltodict](https://pypi.org/project/xmltodict/)** - MIT License
|
||||||
|
|
||||||
* * *
|
---
|
||||||
|
|
||||||
© hyugogirubato 2025
|
© hyugogirubato 2025
|
||||||
|
|||||||
+1
-1
@@ -161,7 +161,7 @@ class ComicInfo(ComicModel):
|
|||||||
|
|
||||||
if XML_NAME in names:
|
if XML_NAME in names:
|
||||||
with archive_file.open(XML_NAME, 'r') as f:
|
with archive_file.open(XML_NAME, 'r') as f:
|
||||||
comic_info = xmltodict.parse(f.read()).get('ComicInfo', {})
|
comic_info = xmltodict.parse(f.read(), force_list=('Page',)).get('ComicInfo', {})
|
||||||
names.remove(XML_NAME)
|
names.remove(XML_NAME)
|
||||||
|
|
||||||
comic = ComicInfo.__extract_info(
|
comic = ComicInfo.__extract_info(
|
||||||
|
|||||||
+1
-2
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
|||||||
|
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "cbz"
|
name = "cbz"
|
||||||
version = "3.4.2"
|
version = "3.4.3"
|
||||||
description = "CBZ simplifies creating, managing, and viewing comic book files in CBZ, CBR, and PDF formats, offering seamless packaging, metadata handling and built-in viewing capabilities."
|
description = "CBZ simplifies creating, managing, and viewing comic book files in CBZ, CBR, and PDF formats, offering seamless packaging, metadata handling and built-in viewing capabilities."
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
authors = ["hyugogirubato <65763543+hyugogirubato@users.noreply.github.com>"]
|
authors = ["hyugogirubato <65763543+hyugogirubato@users.noreply.github.com>"]
|
||||||
@@ -55,7 +55,6 @@ name = "localpypi"
|
|||||||
url = "https://pypi.org/simple/"
|
url = "https://pypi.org/simple/"
|
||||||
priority = "primary"
|
priority = "primary"
|
||||||
|
|
||||||
|
|
||||||
[tool.poetry.group.dev.dependencies]
|
[tool.poetry.group.dev.dependencies]
|
||||||
pytest = ">=7.4.0,<9.0.0"
|
pytest = ">=7.4.0,<9.0.0"
|
||||||
pytest-cov = ">=5.0.0"
|
pytest-cov = ">=5.0.0"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import tempfile
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
@@ -157,3 +158,22 @@ class TestComicInfo:
|
|||||||
|
|
||||||
assert comic.title == 'Empty Test'
|
assert comic.title == 'Empty Test'
|
||||||
assert len(comic.pages) == 0
|
assert len(comic.pages) == 0
|
||||||
|
|
||||||
|
def test_single_page_comic_load(self, images_dir):
|
||||||
|
"""Test loading comic with a single page."""
|
||||||
|
image_paths = sorted(list(images_dir.iterdir()))[:1]
|
||||||
|
pages = [PageInfo.load(path=path) for path in image_paths]
|
||||||
|
|
||||||
|
comic = ComicInfo.from_pages(pages=pages, title="Single Page Test")
|
||||||
|
|
||||||
|
with tempfile.TemporaryDirectory() as temp_dir:
|
||||||
|
temp_path = Path(temp_dir) / "single_page.cbz"
|
||||||
|
data = comic.pack()
|
||||||
|
with open(temp_path, "wb") as f:
|
||||||
|
f.write(data)
|
||||||
|
|
||||||
|
assert temp_path.exists()
|
||||||
|
|
||||||
|
comic_loaded = ComicInfo.from_cbz(temp_path)
|
||||||
|
assert comic_loaded.title == "Single Page Test"
|
||||||
|
assert len(comic_loaded.pages) == 1
|
||||||
|
|||||||
Reference in New Issue
Block a user