Skip to content

Commit

Permalink
Removed languageProfileId as it got deprecated in Sonarr V4
Browse files Browse the repository at this point in the history
  • Loading branch information
Waterboy1602 committed Oct 16, 2024
1 parent a8d1a8a commit f1d7fa4
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 14 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ This is a Telegram Bot made to add series to [Sonarr](https://github.com/Sonarr/
- Translated in English (US), Dutch (Belgium), Spanish (Spain), Italian (Italy), Portuguese (Portugal), Polish (Poland), German (Germany) and French (France)
- Command to give an overview of all the other commands

> [!IMPORTANT]
> Addarr only works with Sonarr V4, because of some breaking API changes between V3 and V4.
## COMMANDS

These are the default commands:
Expand Down
1 change: 0 additions & 1 deletion config_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ sonarr:
password:
search: true # Start search after adding series
seasonFolder: true
languageProfile: English
excludedRootFolders: # If set must not have a trailing slash Eg: /mnt/Media
- # First excluded folder, add others with a "-" on a new line (same indentation)
narrowRootFolderNames: true # If true, only the last folder name will be shown instead of full path
Expand Down
1 change: 0 additions & 1 deletion helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ config: |-
password:
search: true # Start search after adding series
seasonFolder: true
languageProfile: English
excludedRootFolders: # If set must not have a trailing slash Eg: /mnt/Media
- # First excluded folder, add others with a "-" on a new line (same indentation)
narrowRootFolderNames: true # If true, only the last folder name will be shown instead of full path
Expand Down
12 changes: 0 additions & 12 deletions src/sonarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ def removeFromLibrary(tvdbId):


def buildData(json, path, qualityProfileId, tags, seasonsSelected):
# "languageProfileId": getLanguageProfileId(config["languageProfile"]),
built_data = {
"qualityProfileId": qualityProfileId,
"addOptions": {
Expand Down Expand Up @@ -167,17 +166,6 @@ def createTag(tag):
else:
return False


def getLanguageProfileId(language):
parameters = {}
req = requests.get(commons.generateApiQuery("sonarr", "languageProfile", parameters))
parsed_json = json.loads(req.text)
languageId = [l["id"] for l in parsed_json if l["name"] == language]
if len(languageId) == 0:
languageId = [l["id"] for l in parsed_json]
logger.debug("Didn't find a match with languageProfile from the config file. Took instead the first languageId from languageProfile-API response")
return languageId[0]

def getSeasons(tvdbId):
parameters = {"term": "tvdb:" + str(tvdbId)}
req = requests.get(commons.generateApiQuery("sonarr", "series/lookup", parameters))
Expand Down

0 comments on commit f1d7fa4

Please sign in to comment.