Skip to content

Commit

Permalink
Add Sonarr method to get all tags
Browse files Browse the repository at this point in the history
Will be part of /api/available API endpoint in #311
  • Loading branch information
CollinHeist committed Mar 11, 2023
1 parent f645108 commit de40411
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion modules/SonarrInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __init__(self, url: str, api_key: str, verify_ssl: bool=True,

# Parse all Sonarr series
self.__series_data = {}
self.__map_all_series_data()
# self.__map_all_series_data()


def __repr__(self) -> str:
Expand Down Expand Up @@ -403,6 +403,18 @@ def set_episode_ids(self, series_info: SeriesInfo,
self.get_all_episodes(series_info)


def get_all_tags(self) -> list[dict[str, 'str | int']]:
"""
Get all tags present in Sonarr.
Returns:
List of tag dictionary objects with the keys "id" and
"label" for each tag.
"""

return self._get(f'{self.url}tag', self.__standard_params)


def list_all_series_id(self) -> None:
"""List all the series ID's of all shows used by Sonarr. """

Expand Down

0 comments on commit de40411

Please sign in to comment.