mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Make tags import from TMDB configurable
new settings added
This commit is contained in:
parent
838225e962
commit
3d858955b6
@ -11,5 +11,15 @@ namespace MediaBrowser.Providers.Plugins.Tmdb
|
|||||||
/// Gets or sets a value indicating whether include adult content when searching with TMDb.
|
/// Gets or sets a value indicating whether include adult content when searching with TMDb.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IncludeAdult { get; set; }
|
public bool IncludeAdult { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether tags should be imported for series from TMDb.
|
||||||
|
/// </summary>
|
||||||
|
public bool ExcludeTagsSeries { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether tags should be imported for movies from TMDb.
|
||||||
|
/// </summary>
|
||||||
|
public bool ExcludeTagsMovies { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,20 +29,24 @@
|
|||||||
Dashboard.showLoadingMsg();
|
Dashboard.showLoadingMsg();
|
||||||
ApiClient.getPluginConfiguration(PluginConfig.pluginId).then(function (config) {
|
ApiClient.getPluginConfiguration(PluginConfig.pluginId).then(function (config) {
|
||||||
document.querySelector('#includeAdult').checked = config.IncludeAdult;
|
document.querySelector('#includeAdult').checked = config.IncludeAdult;
|
||||||
|
document.querySelector('#excludeTagsSeries').checked = config.ExcludeTagsSeries;
|
||||||
|
document.querySelector('#excludeTagsMovies').checked = config.ExcludeTagsMovies;
|
||||||
Dashboard.hideLoadingMsg();
|
Dashboard.hideLoadingMsg();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
document.querySelector('.configForm')
|
document.querySelector('.configForm')
|
||||||
.addEventListener('submit', function (e) {
|
.addEventListener('submit', function (e) {
|
||||||
Dashboard.showLoadingMsg();
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
ApiClient.getPluginConfiguration(PluginConfig.pluginId).then(function (config) {
|
ApiClient.getPluginConfiguration(PluginConfig.pluginId).then(function (config) {
|
||||||
config.IncludeAdult = document.querySelector('#includeAdult').checked;
|
config.IncludeAdult = document.querySelector('#includeAdult').checked;
|
||||||
|
config.ExcludeTagsSeries = document.querySelector('#excludeTagsSeries').checked;
|
||||||
|
config.ExcludeTagsMovies = document.querySelector('#excludeTagsMovies').checked;
|
||||||
ApiClient.updatePluginConfiguration(PluginConfig.pluginId, config).then(Dashboard.processPluginConfigurationUpdateResult);
|
ApiClient.updatePluginConfiguration(PluginConfig.pluginId, config).then(Dashboard.processPluginConfigurationUpdateResult);
|
||||||
});
|
});
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
@ -57,11 +57,17 @@ namespace MediaBrowser.Providers.Plugins.Tmdb
|
|||||||
|
|
||||||
await EnsureClientConfigAsync().ConfigureAwait(false);
|
await EnsureClientConfigAsync().ConfigureAwait(false);
|
||||||
|
|
||||||
|
var extraMethods = MovieMethods.Credits | MovieMethods.Releases | MovieMethods.Images | MovieMethods.Videos;
|
||||||
|
if (!(Plugin.Instance?.Configuration.ExcludeTagsMovies).GetValueOrDefault())
|
||||||
|
{
|
||||||
|
extraMethods |= MovieMethods.Keywords;
|
||||||
|
}
|
||||||
|
|
||||||
movie = await _tmDbClient.GetMovieAsync(
|
movie = await _tmDbClient.GetMovieAsync(
|
||||||
tmdbId,
|
tmdbId,
|
||||||
TmdbUtils.NormalizeLanguage(language),
|
TmdbUtils.NormalizeLanguage(language),
|
||||||
imageLanguages,
|
imageLanguages,
|
||||||
MovieMethods.Credits | MovieMethods.Releases | MovieMethods.Images | MovieMethods.Keywords | MovieMethods.Videos,
|
extraMethods,
|
||||||
cancellationToken).ConfigureAwait(false);
|
cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
if (movie != null)
|
if (movie != null)
|
||||||
@ -123,11 +129,17 @@ namespace MediaBrowser.Providers.Plugins.Tmdb
|
|||||||
|
|
||||||
await EnsureClientConfigAsync().ConfigureAwait(false);
|
await EnsureClientConfigAsync().ConfigureAwait(false);
|
||||||
|
|
||||||
|
var extraMethods = TvShowMethods.Credits | TvShowMethods.Images | TvShowMethods.ExternalIds | TvShowMethods.Videos | TvShowMethods.ContentRatings | TvShowMethods.EpisodeGroups;
|
||||||
|
if (!(Plugin.Instance?.Configuration.ExcludeTagsSeries).GetValueOrDefault())
|
||||||
|
{
|
||||||
|
extraMethods |= TvShowMethods.Keywords;
|
||||||
|
}
|
||||||
|
|
||||||
series = await _tmDbClient.GetTvShowAsync(
|
series = await _tmDbClient.GetTvShowAsync(
|
||||||
tmdbId,
|
tmdbId,
|
||||||
language: TmdbUtils.NormalizeLanguage(language),
|
language: TmdbUtils.NormalizeLanguage(language),
|
||||||
includeImageLanguage: imageLanguages,
|
includeImageLanguage: imageLanguages,
|
||||||
extraMethods: TvShowMethods.Credits | TvShowMethods.Images | TvShowMethods.Keywords | TvShowMethods.ExternalIds | TvShowMethods.Videos | TvShowMethods.ContentRatings | TvShowMethods.EpisodeGroups,
|
extraMethods: extraMethods,
|
||||||
cancellationToken: cancellationToken).ConfigureAwait(false);
|
cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
if (series != null)
|
if (series != null)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user