Skip to content

Commit d420422

Browse files
authored
fix: correct Prowlarr capabilities
The current `_get_indexer_from_json()` private method only stores the first character of an indexer's `movieSearchParams`/`tvSearchParams`, resulting in Riven only providing the show/movie name to Prowlarr indexers even if they're able to search by year/season/episode. This commit fixes the issue by removing the 0-slice from the list comprehension.
1 parent 4b726e5 commit d420422

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/program/services/scrapers/prowlarr.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def _get_indexer_from_json(self, json_content: str) -> list[ProwlarrIndexer]:
218218
"""Parse the indexers from the XML content"""
219219
indexer_list = []
220220
for indexer in json.loads(json_content):
221-
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))
221+
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))
222222

223223
return indexer_list
224224

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

0 commit comments

Comments
 (0)