Skip to content

Conversation

@aasmoe
Copy link
Contributor

@aasmoe aasmoe commented Jan 8, 2026

Make the language parameter names more clear. Creates a unified method __make_tmdb_request.

It also adds two minor fixes: missing . in metadataProvider/utils.py and make a return value None in movies/router.py
If this looks fine I can adjust tvdb.py in the same way and add multi-language support.

@maxdorninger
Copy link
Owner

looks good! 🎉

@aasmoe aasmoe changed the title Refactor language component tmdb Refactor language component and add primary language support to tvdb provider Jan 12, 2026
@aasmoe
Copy link
Contributor Author

aasmoe commented Jan 12, 2026

Here it is!:)

Copy link
Owner

@maxdorninger maxdorninger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this generally looks good, there are some things which need to be changed or further explained/documented.

  1. Why was the language parameter renamed to original_language, this new name doesn't really make sense.
  2. Also the multi language aspect of the TVDB provider doesn't really work? I mean that it still is always going to get the metadata in English.

I think it'd be better if this were 2 PRs, one for the refactoring of the TMDB provider and one for adding the language feature to the tvdb provider.

Comment on lines 336 to 371
@@ -290,9 +362,10 @@ def get_movie_metadata(

return Movie(
name=movie["name"],
overview="Overviews are not supported with TVDB",
overview=movie.get("overview", "No overview available"),
year=movie.get("year"),
external_id=movie["id"],
metadata_provider=self.name,
imdb_id=imdb_id,
original_language=original_language,
)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused on what the point of the original_language argument is in this function.
It will still get the English metadata from TVDB, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since tvdb provider is still only making plain queries, yes you are right, it is not being used for searching and fetching metadata. Still it serves to add original language to the db record for the show/movie which is consistent with what we already do with tmdb.

Comment on lines +91 to +97
if original_language:
return self.__make_tmdb_request(
endpoint=f"/tv/shows/{show_id}",
original_language=original_language,
context=f"get show metadata for ID {show_id}",
)
raise
return initial_metadata
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if original_language:
return self.__make_tmdb_request(
endpoint=f"/tv/shows/{show_id}",
original_language=original_language,
context=f"get show metadata for ID {show_id}",
)
raise
return initial_metadata
if not original_language:
return initial_metadata

@aasmoe
Copy link
Contributor Author

aasmoe commented Feb 2, 2026

Sorry for making the PR so broad.

  1. Regarding renaming language to original_language and selected_language. When revisiting code, I was confused by the generic name "language". At first this value is captured from the search result when adding media, and then it is matched to primary_languages setting to check if it or default langauge should be used, hence -> selected_langauge. Until it is compared to the primary_languages setting, it is just the original language value being passed. Also it is stored in db as under original_language. I wanted to differentiate it. What do you think?
  2. Yes you are right! No new language functionality is added to metadataproviders>tvdb.py... Currently tvdb provider always shows metadata in the original language? I think I tricked myself and searched for media in my primary languages to test, and I was satisfied when they were displayed as I expected, but it seems all results no matter what are displayed and fetched in original language.

Maybe that is might as well and this PR can be limited to refactoring. The multi language feature for tvdb can be done separately, or what do you think is best?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants