New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New: LanguageId filter added to all movie endpoint #9948
Conversation
Didn't we agreed on Discord on using the language from a query argument? |
language
QSP to the /movie API endpoint
Please let me know if you want a better {
var movieStats = _movieStatisticsService.MovieStatistics();
var translationLanguage = language != null
- ? Language.All.Single(l => l.Name.Equals(language, StringComparison.InvariantCultureIgnoreCase))
+ ? TryOrThrowError(
+ () => Language.All.Single(l => l.Name.Equals(language, StringComparison.InvariantCultureIgnoreCase)),
+ $"Invalid language '{language}'")
: (Language)_configService.MovieInfoLanguage;
var availDelay = _configService.AvailabilityDelay;
var movieTask = Task.Run(() => _moviesService.GetAllMovies());
+ private static T TryOrThrowError<T>(Func<T> func, string error)
+ {
+ try
+ {
+ return func();
+ }
+ catch
+ {
+ throw new Exception(error);
+ }
+ } |
I would rather go with something like I think we should find another solution for the lookup to not use the language names... Radarr/src/NzbDrone.Core/Languages/Language.cs Lines 8 to 11 in 3db7807
|
Hey, I updated the code to exclude non-real languages with I don't see any issue with using language names as both names and ids are hardcoded and reachable via the api. |
Hey, yeah, we should rather go with the language Id instead being an integer. |
done! |
9927d5d
to
15551b0
Compare
language
QSP to the /movie API endpoint
Database Migration
NO
Description
When implementing some automation tools, it is important to have consistent movie naming independently of the language that the radarr users have configured. For this purpose, I added a new QSP
language
to the/movie
endpoint to return the results in whatever language you prefer.Examples
/api/v3/movie
with Metadata Language set toFrench
:/api/v3/movie?language=spanish
/api/v3/movie?language=non-existing
Todos