elgatito / script.elementum.burst

Development of this addon has been stopped!
MIT License
115 stars 118 forks source link

Set "en" to "original" if "en" is empty and "original_language"="en" #424

Open antonsoroko opened 1 month ago

antonsoroko commented 1 month ago

(this logic actually should be done for any language. We should set "X" to "original" if "X" is empty and "original_language"="X".)

We should set "en" to "original" if "en" is empty and "original_language"="en". as i can see usually "en" is empty when "original_language"="en". so then we can some irrelevant name from alternative_titles since we treat us as en:

example https://api.themoviedb.org/3/tv/1399?api_key=29a551a65eef108dd01b46e27eb0554a&append_to_response=credits,alternative_titles,translations,external_ids,trailers,release_dates,content_ratings&include_image_language=ru,en,null&include_video_language=ru,en,null&language=ru

  "original_language": "en",
  "original_name": "Game of Thrones",
  ...
  "translations": {
    "translations": [
      {
        "iso_3166_1": "US",
        "iso_639_1": "en",
        "name": "English",
        "english_name": "English",
        "data": {
          "name": "",
  ...
  "alternative_titles": {
    "results": [          
      {
        "iso_3166_1": "US",
        "title": "GoT",
        "type": "common abbreviation"
      },

so we get "en" as "GoT" instead of "Game of Thrones". so if tracker has only {title:en} then it is screwed.

antonsoroko commented 1 month ago

i think we need to move https://github.com/elgatito/elementum/blob/2c644cdb6d2908b4d2dfbe0e17c1f2fdea5ef7d5/providers/xbmc.go#L372-L373

after AlternativeTitles/Translations thus title for OriginalLanguage and user's language will be always correct.