grawlix wrote no metadata into the epub for EpubInParts sources (e.g. Nextory):
the ebooklib rebuild set no title/author/series, so the OPF held only a UUID.
SingleFile sources (e.g. Storytel) keep the publisher OPF, which has title and
author but no series. Either way a library manager can only fall back to the
filename.
Add Epub._embed_metadata(location, metadata): after the file is written, ADD any
missing dc:title/creator/language/publisher/date + calibre:series/series_index
from book.metadata to the OPF. It is add-only (never removes or rewrites existing
OPF elements, so publisher metadata, EPUB3 refines and comments stay intact),
respects the OPF's declared encoding, reads entries by ZipInfo, and swallows all
errors so it can never turn a successful download into a failure.
Supporting changes:
- Populate the Nextory Metadata with index (volume), language, publisher and
release_date so those fields exist to embed and to fill output templates.
- str()-coerce metadata values when building the output path, so a numeric
series index does not crash remove_unwanted_chars.
- Remove the stray exit() at the end of _download_epub_in_parts (also fixed in
#27) — a prerequisite for the embed step to run for EpubInParts sources.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Fix Nextory: bump X-App-Version and handle null series
The Nextory API now rejects the old X-App-Version "5.4.1" with an
AppDeprecateError. Bump it to "2026.05.4" (current Android app version).
Also, the product API can return {"series": null} for standalone books
(not just omit the key entirely). The previous `"series" in product_info`
check passed in that case and we crashed on a NoneType subscript.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Add urllib3 as explicit dependency
grawlix/sources/storytel.py imports urllib3.util.parse_url but urllib3
was only pulled in transitively. Fresh installs (e.g. via uv tool) fail
at import time with ModuleNotFoundError.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Fix invalid escape sequence warning in saxo regex
f"\d+$" produced a SyntaxWarning on Python 3.12 (and will become a
SyntaxError in a future release). The string has no interpolation, so
the raw form r"\d+$" is the right fix.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Support the new system for eReolen where user access it through their
local libraries.
This new system makes the `--library` argument unnecessary and has
therefore also been removed.
Formats can now be loaded based on book data format and file extension
of the output file. Will also try to use the extension of the output
location instead of using the default filetype every time.