mirror of
https://github.com/calibrain/shelfmark.git
synced 2026-04-19 21:39:17 -04:00
- Base URL option in settings for reverse proxy setups - Fix NZB downloads not deleting on completion - Fix handling for audiobook files over 100+ parts - Fix prowlarr search timeout - Fix prowlarr categorisation for expanded searches
30 lines
1.2 KiB
Python
30 lines
1.2 KiB
Python
from shelfmark.metadata_providers import BookMetadata
|
|
from shelfmark.core.search_plan import build_release_search_plan
|
|
|
|
|
|
class TestReleaseSearchPlanManualQuery:
|
|
def test_manual_query_overrides_plan(self, monkeypatch):
|
|
import shelfmark.core.search_plan as sp
|
|
|
|
monkeypatch.setattr(sp.config, "BOOK_LANGUAGE", ["en", "hu"], raising=False)
|
|
|
|
book = BookMetadata(
|
|
provider="hardcover",
|
|
provider_id="123",
|
|
title="Mistborn: The Final Empire",
|
|
search_title="The Final Empire",
|
|
search_author="Brandon Sanderson",
|
|
authors=["Brandon Sanderson"],
|
|
titles_by_language={"hu": "A végső birodalom"},
|
|
isbn_13="9780765311788",
|
|
)
|
|
|
|
plan = build_release_search_plan(book, languages=None, manual_query="some custom query")
|
|
|
|
assert plan.manual_query == "some custom query"
|
|
assert plan.isbn_candidates == []
|
|
assert plan.languages == ["en", "hu"]
|
|
assert [v.query for v in plan.title_variants] == ["some custom query"]
|
|
assert [v.title for v in plan.title_variants] == ["some custom query"]
|
|
assert [(v.title, v.languages) for v in plan.grouped_title_variants] == [("some custom query", None)]
|