Skip to content
Merged
Changes from all commits
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
3 changes: 2 additions & 1 deletion app/services/stremio/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ async def get_library_items(self, auth_key: str) -> dict[str, list[dict[str, Any
if item.get("type") not in ["movie", "series"]:
continue
item_id = item.get("_id", "")
if not item_id.startswith("tt"):
if not item_id.startswith("tt") and not item_id.startswith("tmdb:"):
# either imdb id or tmdb id should be there.
Comment on lines +77 to +78

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better readability and conciseness, you can provide a tuple of prefixes to the startswith() method. This simplifies the conditional check.

Additionally, the comment on the following line becomes redundant as the refactored code is self-explanatory.

Suggested change
if not item_id.startswith("tt") and not item_id.startswith("tmdb:"):
# either imdb id or tmdb id should be there.
if not item_id.startswith(("tt", "tmdb:")):

continue

# Check Watched status
Expand Down