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: update ListrrAPI validate method to use correct path #906

Merged
merged 1 commit into from
Nov 28, 2024
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
2 changes: 1 addition & 1 deletion src/program/apis/listrr_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self, api_key: str):
self.trakt_api = di[TraktAPI]

def validate(self):
return self.request_handler.execute(HttpMethod.GET, self.BASE_URL)
return self.request_handler.execute(HttpMethod.GET, "")

def get_items_from_Listrr(self, content_type, content_lists) -> list[MediaItem] | list[str]: # noqa: C901, PLR0912
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Type annotation appears inconsistent with implementation

The method is annotated to return list[MediaItem] | list[str], but the implementation only returns a list of IMDb ID strings (list[str]). There's no code path that returns MediaItem objects.

Consider one of these fixes:

-def get_items_from_Listrr(self, content_type, content_lists) -> list[MediaItem] | list[str]:
+def get_items_from_Listrr(self, content_type, content_lists) -> list[str]:

Or if MediaItem objects should be returned, update the implementation accordingly.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
def get_items_from_Listrr(self, content_type, content_lists) -> list[MediaItem] | list[str]: # noqa: C901, PLR0912
def get_items_from_Listrr(self, content_type, content_lists) -> list[str]: # noqa: C901, PLR0912

"""Fetch unique IMDb IDs from Listrr for a given type and list of content."""
Expand Down
Loading