From e91de654d78c847d482fb9ca315eca31d044d770 Mon Sep 17 00:00:00 2001 From: Joe Rogers <1337joe@gmail.com> Date: Sun, 17 Dec 2023 22:14:11 -0500 Subject: [PATCH] Stop saving Jellyfin API key in settings xml --- .../Plugins/Tmdb/Configuration/PluginConfiguration.cs | 2 +- MediaBrowser.Providers/Plugins/Tmdb/TmdbClientManager.cs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs b/MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs index e9cd81a14e..99b759ae29 100644 --- a/MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs +++ b/MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs @@ -11,7 +11,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb /// Gets or sets a value to use as the API key for accessing TMDb. This is intentionally excluded from the /// settings page as the API key should not need to be changed by most users. /// - public string TmdbApiKey { get; set; } = TmdbUtils.ApiKey; + public string TmdbApiKey { get; set; } = string.Empty; /// /// Gets or sets a value indicating whether include adult content when searching with TMDb. diff --git a/MediaBrowser.Providers/Plugins/Tmdb/TmdbClientManager.cs b/MediaBrowser.Providers/Plugins/Tmdb/TmdbClientManager.cs index 1402104334..82f2c54f16 100644 --- a/MediaBrowser.Providers/Plugins/Tmdb/TmdbClientManager.cs +++ b/MediaBrowser.Providers/Plugins/Tmdb/TmdbClientManager.cs @@ -36,7 +36,11 @@ namespace MediaBrowser.Providers.Plugins.Tmdb public TmdbClientManager(IMemoryCache memoryCache) { _memoryCache = memoryCache; - _tmDbClient = new TMDbClient(Plugin.Instance.Configuration.TmdbApiKey); + + var apiKey = Plugin.Instance.Configuration.TmdbApiKey; + apiKey = string.IsNullOrEmpty(apiKey) ? TmdbUtils.ApiKey : apiKey; + _tmDbClient = new TMDbClient(apiKey); + // Not really interested in NotFoundException _tmDbClient.ThrowApiExceptions = false; }