Skip to content

Commit

Permalink
fix: string to bool using attrs func
Browse files Browse the repository at this point in the history
  • Loading branch information
chkpwd committed Oct 25, 2024
1 parent 5fa766b commit dc90c75
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/sonarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ def configure_monitoring(monitored_list: list):
api_instance = sonarr.EpisodeApi(api_client)

episodes_monitored_resource = sonarr.EpisodesMonitoredResource(
episodeIds=[*monitored_list]
episodeIds=[*monitored_list],
monitored=True
)
episodes_monitored_resource.monitored = True

try:
api_instance.put_episode_monitor(
Expand Down
16 changes: 8 additions & 8 deletions constants/variables.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import os
import sys
import attrs
import logging

from attrs.converters import to_bool
from dotenv import load_dotenv


Expand Down Expand Up @@ -34,18 +36,16 @@ def __init__(self):
self.afl_anime_name: str = self._get_env_var("AFL_ANIME_NAME", required=True)
self.sonarr_url: str = self._get_env_var("SONARR_URL", required=True)
self.sonarr_series_id: int = int(
self._get_env_var("SONARR_SERIES_ID", required=True, default="")
self._get_env_var("SONARR_SERIES_ID", required=True)
)
self.sonarr_api_key: str = self._get_env_var("SONARR_API_KEY", required=True)
self.monitor_non_filler_sonarr_episodes: bool = bool(
self._get_env_var("MONITOR_NON_FILLER_SONARR_EPISODES", default="")
self.monitor_non_filler_sonarr_episodes: bool = to_bool(
self._get_env_var("MONITOR_NON_FILLER_SONARR_EPISODES", required=True, default="True")
)
self.plex_url: str = self._get_env_var("PLEX_URL")
self.plex_token: str = self._get_env_var(
"PLEX_TOKEN", required=bool(self.plex_url)
)
self.create_plex_collection: bool = bool(
self._get_env_var("CREATE_PLEX_COLLECTION", default="")
self.plex_token: str = self._get_env_var("PLEX_TOKEN")
self.create_plex_collection: bool = to_bool(
self._get_env_var("CREATE_PLEX_COLLECTION", required=True, default="False")
)
self.plex_anime_library: str = self._get_env_var("PLEX_ANIME_LIBRARY")

Expand Down

0 comments on commit dc90c75

Please sign in to comment.