jellyfin-plugin-tvdb icon indicating copy to clipboard operation
jellyfin-plugin-tvdb copied to clipboard

TVDB Language Fallback Not Working

Open jomp16 opened this issue 5 years ago • 23 comments

Describe the bug Jellyfin doesn't use the default language, English, to fill missing metadata not available in the default metadata language of the library.

To Reproduce

  1. Go to admin panel
  2. Change language metadata of a library for some language not available in TV series or anime in TheTVDB.
  3. Refresh metadata replacing all previous metadata.
  4. Go to the TV series or anime.
  5. See missing title, or synopsis, since the choosen language doesn't have it.

Expected behavior Jellyfin should pick what it can fron the choosen language, but if the metadata is missing (either title, or synopsis, or idk), fallback to English and pick only the missing metadata.

Logs Jellyfin doesn't throws any error in logs.

Screenshots No screenshot yet.

System (please complete the following information):

  • OS: Docker on Linux
  • Browser: Chrome 74.0.3729.131
  • Jellyfin Version: 10.3.2
  • Reverse proxy: nginx

Additional context From what I remember, with TheTVDB v1, Jellyfin picked the English one if it found a missing metadata from the choosen language.

jomp16 avatar May 01 '19 19:05 jomp16

Okay, I can confirm that it doesn't fallback to English. I haven't tested this against any earlier version, so are we sure this worked before?

anthonylavado avatar May 07 '19 05:05 anthonylavado

I'm sure that Emby before they closed the source code did the fallback to English, but I'm not so sure about Jellyfin before the v2 API migration.

If you want to make sure, then when I'll have the time, I'll download a docker container of version 10.0.0 (I guess that was the version before the v2 change, please confirm it for me), and I'll create a new config and library that doesn't have the Portuguese metadata, to check if Jellyfin will fallback to English.

jomp16 avatar May 07 '19 10:05 jomp16

@jomp16 The change was actually in 10.3, so using a version like 10.2.2 should work.

anthonylavado avatar May 07 '19 16:05 anthonylavado

Pulled docker image for 10.2.2, currently it's indexing my Animes library, when it finishes, I'll take a look if it did fallback to English.

jomp16 avatar May 07 '19 16:05 jomp16

Take a look on it:

https://www.thetvdb.com/series/sword-art-online-alternative-gun-gale-online/episodes/6638735

There's a portuguese (Português) title "Perdedor do SAO", but no synopsis, right?

Jellyfin took the English synopsis as the fallback

image

I hope that helps you that it worked before.

jomp16 avatar May 07 '19 16:05 jomp16

Another case:

https://www.thetvdb.com/series/yuki-yuna-is-a-hero/episodes/4946029

https://www.thetvdb.com/series/yuki-yuna-is-a-hero/seasons/1

You can see there isn't "Português" tab, for the entire season of Yuki Yuna is a Hero so there isn't any localized title or synopsis, right?

image

As you can see, Jellyfin did fallback to English title to fill the missing metadata.

jomp16 avatar May 07 '19 16:05 jomp16

@jomp16 Awesome! Thank you for confirming. We'll have to look at it in closer detail. The TVDB API v2 is... complex to say the least.

anthonylavado avatar May 07 '19 16:05 anthonylavado

Another thing I think we should take a look is:

TheTVDB v2 doesn't returns all images (banners, logo, etc), even if it's checked "all languages".

Not sure if it's related to this issue, or it's another issue.

I'll try to remember which anime Jellyfin didn't pick the images, even with all languages checked, to check if 10.2.2 works correctly.

jomp16 avatar May 07 '19 16:05 jomp16

So I wonder if this is related: https://forums.thetvdb.com/viewtopic.php?f=116&t=55870

anthonylavado avatar May 21 '19 04:05 anthonylavado

Aha! So I tested the series mentioned here: https://github.com/jellyfin/jellyfin/issues/1342#issuecomment-490153951

This is the response I get from TheTVDB, when requesting language "en" and "pr":

TVDB API v2 Response for language "en"
{
  "data": {
    "id": 6638735,
    "airedSeason": 1,
    "airedSeasonID": 732221,
    "airedEpisodeNumber": 6,
    "episodeName": "SAO Loser",
    "firstAired": "2018-05-20",
    "guestStars": [],
    "director": "|Masayuki Sakoi|",
    "directors": [
      "Masayuki Sakoi"
    ],
    "writers": [
      "Yōsuke Kuroda"
    ],
    "overview": "It's Spring break for Karen, and as she returns from her hometown back to Tokyo, she gets a very unexpected guest.",
    "language": {
      "episodeName": "en",
      "overview": "en"
    },
    "productionCode": "",
    "showUrl": "",
    "lastUpdated": 1544637940,
    "dvdDiscid": "|ANZX-14185/6|ANZB-14185/6|",
    "dvdSeason": 1,
    "dvdEpisodeNumber": 6,
    "dvdChapter": null,
    "absoluteNumber": 6,
    "filename": "episodes/335815/6638735.jpg",
    "seriesId": 335815,
    "lastUpdatedBy": 515485,
    "airsAfterSeason": null,
    "airsBeforeSeason": null,
    "airsBeforeEpisode": null,
    "thumbAuthor": 457823,
    "thumbAdded": "2018-05-18 19:45:41",
    "thumbWidth": "400",
    "thumbHeight": "225",
    "imdbId": "tt8375858",
    "siteRating": 0,
    "siteRatingCount": 0
  }
}
TVDB API v2 Response for language "pr"
{
  "data": {
    "id": 6638735,
    "airedSeason": 1,
    "airedSeasonID": 732221,
    "airedEpisodeNumber": 6,
    "episodeName": "Perdedor do SAO",
    "firstAired": "2018-05-20",
    "guestStars": [],
    "director": "|Masayuki Sakoi|",
    "directors": [
      "Masayuki Sakoi"
    ],
    "writers": [
      "Yōsuke Kuroda"
    ],
    "overview": null,
    "language": {
      "episodeName": "pt",
      "overview": "pt"
    },
    "productionCode": "",
    "showUrl": "",
    "lastUpdated": 1544637940,
    "dvdDiscid": "|ANZX-14185/6|ANZB-14185/6|",
    "dvdSeason": 1,
    "dvdEpisodeNumber": 6,
    "dvdChapter": null,
    "absoluteNumber": 6,
    "filename": "episodes/335815/6638735.jpg",
    "seriesId": 335815,
    "lastUpdatedBy": 515485,
    "airsAfterSeason": null,
    "airsBeforeSeason": null,
    "airsBeforeEpisode": null,
    "thumbAuthor": 457823,
    "thumbAdded": "2018-05-18 19:45:41",
    "thumbWidth": "400",
    "thumbHeight": "225",
    "imdbId": "tt8375858",
    "siteRating": 0,
    "siteRatingCount": 0
  },
  "errors": {
    "invalidLanguage": "Some translations were not available in the specified language"
  }
}

The key part is in the "pr" request, there is this value:

"overview": null

and this message:

  "errors": {
    "invalidLanguage": "Some translations were not available in the specified language"
}

This is consistent with what the API doc says:

Records are returned with the Episode name and Overview in the desired language, if it exists. If there is no translation for the given language, then the record is still returned but with empty values for the translated fields.

Apparently this has been a problem for some time, as seen on The TVDB Forums.


It's a difficult issue. Each request will only accept one language. In the v1 API, it would fallback to English automatically, as the site was originally created with only English supported. We would want to keep using v1 (just like Emby has), but the problem is that it will eventually be shut off (source). The only API keys you can get today are v2 keys, and you can't request a v1 key (we had a legacy one given to us by another user on a temporary basis).

At this point, I don't think we can do anything unless TheTVDB changes their behaviour. It seems they are open to the idea (source), but keep forgetting.

anthonylavado avatar May 21 '19 04:05 anthonylavado

I've asked about this here: https://forums.thetvdb.com/viewtopic.php?f=17&t=56023

anthonylavado avatar May 21 '19 04:05 anthonylavado

Wow, at least we know why it stopped working.

How about we create a new option, called fallback language, in the library settings, that makes Jellyfin fallback to the selected language?

Example:

  • Main language: portuguese, fallback: english, if portuguese has any missing metadata (the error tag says so), Jellyfin will request again using the fallback language, and then merge two JSON return into one?

Or make Jellyfin request a choosen metadata language + English (always) at same time, and then merge the JSON output and fill the metadata?

jomp16 avatar May 21 '19 13:05 jomp16

@jomp16 Yeah, I think it’s a good idea to have the choice of a fallback language. It should default to English, but be configurable.

On Matrix, @cvium has mentioned the following:

Anthony Lavado: I think it's fairly easy to do our own fallback since we have a single point of entry here: https://github.com/jellyfin/jellyfin/blob/master/MediaBrowser.Providers/TV/TheTVDB/TvDbClientManager.cs#L205

I guess the way to go is:

  • Have a primary language for metadata
  • If null is returned for any value, and Errors exists with “invalidLanguage”, search fallback language for those fields
  • Merge with found results

I do agree with one thing the TVDB people said, which is that when you get to non-English shows, always using English as a fallback might still produce missing data (hence the configurable secondary language). At least English should be the most popular, so I think it’s a good default.

anthonylavado avatar May 21 '19 16:05 anthonylavado

Issues go stale after 60d of inactivity. Mark the issue as fresh by adding a comment or commit. Stale issues close after an additional 7d of inactivity. If this issue is safe to close now please do so. If you have any questions you can reach us on Matrix or Social Media.

stale[bot] avatar Jul 29 '19 20:07 stale[bot]

Any progress on this issue?

(Preventing the bot from closing this)

jomp16 avatar Jul 29 '19 22:07 jomp16

@jomp16 - ah not yet, sorry about that. There have been some backend changes with TVDB, so we’ve been waiting for those to settle.

anthonylavado avatar Jul 30 '19 05:07 anthonylavado

I just jump into discussion. TBH it would be nice to have fallback in this style:

Prefered language (slovak for example) >> fallback to language 2 (czech for example) >> fallback to language 3 (english for example).

In europe would make this big sense, many countries use multiple languages. At least toggles for localized poster, plot and rating should be added, with fallback to selected language (for example, localized would be Slovak and fallback English).

It should be all about customization, as all thing regarding metadata :)

nextlooper42 avatar Jul 31 '19 18:07 nextlooper42

Issues go stale after 90d of inactivity. Mark the issue as fresh by adding a comment or commit. Stale issues close after an additional 14d of inactivity. If this issue is safe to close now please do so. If you have any questions you can reach us on Matrix or Social Media.

stale[bot] avatar Oct 29 '19 18:10 stale[bot]

shoo bot, we're working on this in another branch

anthonylavado avatar Oct 29 '19 21:10 anthonylavado

Still broken in 10.6.2

nextlooper42 avatar Sep 28 '20 23:09 nextlooper42

Still broken in 10.6.4

virusperfect avatar Nov 22 '20 15:11 virusperfect

Any progress on this?

LinAGKar avatar Mar 04 '22 19:03 LinAGKar

Any progress on this?

makuc avatar Jun 05 '23 15:06 makuc