Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct Prowlarr capabilities #879

Merged
merged 2 commits into from
Nov 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/program/services/scrapers/prowlarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def _get_indexer_from_json(self, json_content: str) -> list[ProwlarrIndexer]:
"""Parse the indexers from the XML content"""
indexer_list = []
for indexer in json.loads(json_content):
indexer_list.append(ProwlarrIndexer(title=indexer["name"], id=str(indexer["id"]), link=indexer["infoLink"], type=indexer["protocol"], language=indexer["language"], movie_search_capabilities=(s[0] for s in indexer["capabilities"]["movieSearchParams"]) if len([s for s in indexer["capabilities"]["categories"] if s["name"] == "Movies"]) > 0 else None, tv_search_capabilities=(s[0] for s in indexer["capabilities"]["tvSearchParams"]) if len([s for s in indexer["capabilities"]["categories"] if s["name"] == "TV"]) > 0 else None))
indexer_list.append(ProwlarrIndexer(title=indexer["name"], id=str(indexer["id"]), link=indexer["infoLink"], type=indexer["protocol"], language=indexer["language"], movie_search_capabilities=(s for s in indexer["capabilities"]["movieSearchParams"]) if len([s for s in indexer["capabilities"]["categories"] if s["name"] == "Movies"]) > 0 else None, tv_search_capabilities=(s for s in indexer["capabilities"]["tvSearchParams"]) if len([s for s in indexer["capabilities"]["categories"] if s["name"] == "TV"]) > 0 else None))
Gaisberg marked this conversation as resolved.
Show resolved Hide resolved

return indexer_list

Expand Down Expand Up @@ -262,4 +262,4 @@ def _log_indexers(self) -> None:
if not indexer.movie_search_capabilities:
logger.debug(f"Movie search not available for {indexer.title}")
if not indexer.tv_search_capabilities:
logger.debug(f"TV search not available for {indexer.title}")
logger.debug(f"TV search not available for {indexer.title}")