toddrob99 / searcharr

Sonarr & Radarr & Readarr Telegram Bot
MIT License
244 stars 62 forks source link

Multilanguage Support - Missing languageProfileId for Sonarr API Requests #51

Closed Seriox closed 1 year ago

Seriox commented 1 year ago

Issue: When having more than one Language Profiles enabled in Sonarr, every TV Show added within Searcharr defaults to English (or languageProfileId = 1) As I like to watch some TV shows in English and other in German I manually select the language Profile in Sonarr when adding a new Series.

The parameter is missing in Sonarr API Documentation but I've confirmed that it's working with a CURL Request. You can also see the parameter in Chrome Dev Tools.

curl --header "Content-Type: application/json" \
  --request POST \
  --data '{"qualityProfileId":4,"tvdbId":78107,"languageProfileId":2,"title":"The Office","titleSlug":"the-office","images":[{"coverType": "banner","url": "/MediaCover/166/banner.jpg?lastWrite=637961218386683368","remoteUrl":"https://artworks.thetvdb.com/banners/v4/series/401998/banners/62a90eafd0318.jpg"},{"coverType": "poster","url": "/MediaCover/166/poster.jpg?lastWrite=637961218388043342","remoteUrl":"https://artworks.thetvdb.com/banners/v4/series/401998/posters/62cc2623984e8.jpg"},{"coverType": "fanart","url": "/MediaCover/166/fanart.jpg?lastWrite=637961218390003303","remoteUrl":"https://artworks.thetvdb.com/banners/v4/series/401998/backgrounds/62a0d9f3da7a2.jpg"}],"seasons":[{"seasonNumber": 1,"monitored": true}],"path":"/tv/The Office"}' \
  http://sonarr:8989/api/v3/series?apikey=<API KEY>

image

Solution: The easiest solution would probably be a static parameter in settings.py. The best solution would probably be a choice between different languageProfiles when adding a Series in Searcharr.

Thank you very much, Searcharr works great so far! 👍

toddrob99 commented 1 year ago

It appears Sonarr is deprecating language profiles and adding language support to custom formats instead. After upgrading to Sonarr v4 in my test instance, the response to the languageprofile API endpoint has changed to this (I had multiple languages enabled in the language profile before, and it was not named "Deprecated"):

[
  {
    "name": "Deprecated",
    "upgradeAllowed": true,
    "cutoff": {
      "id": 1,
      "name": "English"
    },
    "languages": [
      {
        "language": {
          "id": 1,
          "name": "English"
        },
        "allowed": true
      }
    ],
    "id": 1
  }
]

As a result, I am going to remove language profile support from Searcharr v3.