Repository navigation
feat(metadata): choose the Amazon store used by the Amazon provider - #1671
Open
privatepenguinzero wants to merge 1 commit into
Open
privatepenguinzero wants to merge 1 commit into
privatepenguinzero wants to merge 1 commit into
Conversation
The Amazon metadata provider was hardcoded to amazon.com, so books from other countries only got English editions. Add a "Amazon Store" setting (metadata_amazon_domain, default "com") to the metadata provider settings, like the region option of the Amazon source in Calibre desktop. - amazon.py: build search and product URLs from the selected store and send a matching Accept-Language header; unknown values fall back to amazon.com - series bullet parsing also understands "Libro 2 di 5", "Buch 2 von 5", "Tome 2 sur 5"... used by non-English stores - skip absolute sponsored-ad links in results (they produced 404s) - unit tests for the domain setting, series parsing and request URL Japan keeps its own provider (amazonjp). Refs crocodilestick#1606.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Choose the Amazon store for the Amazon metadata provider
Closes #1606.
The Amazon provider always searched amazon.com, so libraries in other languages only got English editions (titles, descriptions, covers). This adds an Amazon Store setting under the metadata provider settings, similar to the region option of the Amazon source in Calibre desktop.
Changes
metadata_amazon_domain(TEXT, default'com') incwa_schema.sql. Existing installs get the column through the usual schema sync, and the default keeps today's behaviour.amazon.py:Accept-Languageheaderhttps://www.amazon.com/https://...and returned 404)amazonjp), soco.jpisn't in the list.Testing
tests/unit/test_amazon_provider.py(18 tests): domain normalisation, localized series parsing, the search request using the configured store, and the fallback when the settings DB can't be read.comand withit/de: each returns that store's local editions, andcombehaves as before.