Skip to content

Commit

Permalink
fix: change mdblist str to int (#382)
Browse files Browse the repository at this point in the history
Co-authored-by: Spoked <Spoked@localhost>
  • Loading branch information
dreulavelle and Spoked authored Jun 11, 2024
1 parent 5e1eada commit b88c475
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions backend/program/content/mdblist.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ def validate(self):
if not self.settings.enabled:
logger.warning("Mdblist is set to disabled.")
return False
if self.settings.lists == [""]:
logger.error("Mdblist is enabled, but list is empty.")
return False
if self.settings.api_key == "" or len(self.settings.api_key) != 25:
logger.error("Mdblist api key is not set.")
return False
if not self.settings.lists:
logger.error("Mdblist is enabled, but list is empty.")
return False
response = ping(f"https://mdblist.com/api/user?apikey={self.settings.api_key}")
if "Invalid API key!" in response.text:
logger.error("Mdblist api key is invalid.")
Expand Down Expand Up @@ -71,7 +71,7 @@ def my_limits(api_key: str):
return response.data


def list_items(list_id: str, api_key: str):
def list_items(list_id: int, api_key: str):
"""Wrapper for mdblist api method 'List items'"""
response = get(f"http://www.mdblist.com/api/lists/{list_id}/items?apikey={api_key}")
response = get(f"http://www.mdblist.com/api/lists/{str(list_id)}/items?apikey={api_key}")
return response.data
2 changes: 1 addition & 1 deletion backend/program/content/overseerr.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def validate(self) -> bool:
response = ping(
self.settings.url + "/api/v1/auth/me",
additional_headers=self.headers,
timeout=15,
timeout=30,
)
if response.status_code >= 201:
logger.error(
Expand Down
2 changes: 1 addition & 1 deletion backend/program/settings/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class ListrrModel(Updatable):
class MdblistModel(Updatable):
enabled: bool = False
api_key: str = ""
lists: list[str] = []
lists: list[int] = []
update_interval: int = 300


Expand Down

0 comments on commit b88c475

Please sign in to comment.