aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Providers/Plugins/Tmdb/Configuration
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Providers/Plugins/Tmdb/Configuration')
-rw-r--r--MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs47
-rw-r--r--MediaBrowser.Providers/Plugins/Tmdb/Configuration/config.html75
2 files changed, 122 insertions, 0 deletions
diff --git a/MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs b/MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs
index 78405c21fc..b3a67189bb 100644
--- a/MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs
+++ b/MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CA1819 // Properties should not return arrays
+
using MediaBrowser.Model.Plugins;
namespace MediaBrowser.Providers.Plugins.Tmdb
@@ -34,6 +36,51 @@ namespace MediaBrowser.Providers.Plugins.Tmdb
public bool ImportSeasonName { get; set; }
/// <summary>
+ /// Gets or sets a value indicating whether unaired (upcoming) episodes should be created as
+ /// virtual items from the episode list provided by TMDb. These populate the "Upcoming" view.
+ /// Enabling this will increase scan times.
+ /// </summary>
+ public bool ImportUnairedEpisodes { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether already aired episodes that are not present in the
+ /// library should be created as virtual items from the episode list provided by TMDb. These
+ /// surface as missing episodes. Enabling this will increase scan times.
+ /// </summary>
+ public bool ImportMissingEpisodes { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether specials (season 0) should be included when creating
+ /// virtual unaired or missing episodes. When disabled, specials are never added and any existing
+ /// virtual specials created by this provider are removed.
+ /// </summary>
+ public bool ImportSpecials { get; set; }
+
+ /// <summary>
+ /// Gets or sets the ids (the "N" formatted GUIDs from <c>VirtualFolderInfo.ItemId</c>) of the
+ /// libraries for which the unaired/missing episode provider is enabled. Whether episodes are
+ /// imported at all, and how, is still controlled by the global toggles above; those toggles only
+ /// apply to the libraries listed here. Libraries not listed, including newly added ones, are
+ /// never processed, so an empty list disables the feature entirely.
+ /// </summary>
+ public string[] EnabledMissingEpisodeLibraries { get; set; } = [];
+
+ /// <summary>
+ /// Gets or sets how often, in days, the scheduled task re-checks TMDb for newly announced
+ /// unaired or missing episodes. This is what keeps the "Upcoming" view current for series
+ /// whose local files have not changed.
+ /// </summary>
+ public int MissingEpisodeRefreshIntervalDays { get; set; } = 7;
+
+ /// <summary>
+ /// Gets or sets the number of days a virtual episode is retained after it airs before it is
+ /// pruned (when missing episode import is disabled). This grace period leaves recently aired
+ /// episodes in place to allow for the delay between an episode airing and its file being added
+ /// to the library.
+ /// </summary>
+ public int UpcomingEpisodeGracePeriodDays { get; set; } = 7;
+
+ /// <summary>
/// Gets or sets a value indicating the maximum number of cast members to fetch for an item.
/// </summary>
public int MaxCastMembers { get; set; } = 15;
diff --git a/MediaBrowser.Providers/Plugins/Tmdb/Configuration/config.html b/MediaBrowser.Providers/Plugins/Tmdb/Configuration/config.html
index 4048fc1655..582753759f 100644
--- a/MediaBrowser.Providers/Plugins/Tmdb/Configuration/config.html
+++ b/MediaBrowser.Providers/Plugins/Tmdb/Configuration/config.html
@@ -25,6 +25,40 @@
<input is="emby-checkbox" type="checkbox" id="importSeasonName" />
<span>Import season name from metadata fetched for series.</span>
</label>
+ <div class="checkboxContainer checkboxContainer-withDescription">
+ <label>
+ <input is="emby-checkbox" type="checkbox" id="importUnairedEpisodes" />
+ <span>Create unaired (upcoming) episodes from metadata fetched for series.</span>
+ </label>
+ <div class="fieldDescription checkboxFieldDescription">Adds virtual entries for episodes listed on TMDb that have not aired yet. This populates the "Upcoming" view. Specials are never added to the "Upcoming" view.</div>
+ </div>
+ <div class="checkboxContainer checkboxContainer-withDescription">
+ <label>
+ <input is="emby-checkbox" type="checkbox" id="importMissingEpisodes" />
+ <span>Create missing episodes from metadata fetched for series.</span>
+ </label>
+ <div class="fieldDescription checkboxFieldDescription">Adds virtual entries for episodes listed on TMDb that have already aired but are not present in your library. Missing episodes are only shown when enabled in the user display preferences. Both options increase scan times.</div>
+ </div>
+ <div class="checkboxContainer checkboxContainer-withDescription">
+ <label>
+ <input is="emby-checkbox" type="checkbox" id="importSpecials" />
+ <span>Include specials when creating unaired and missing episodes.</span>
+ </label>
+ <div class="fieldDescription checkboxFieldDescription">When disabled, specials (season 0) are never added as virtual entries and any existing virtual specials are removed.</div>
+ </div>
+ <div class="inputContainer inputContainer-withDescription">
+ <input is="emby-input" type="number" id="missingEpisodeRefreshIntervalDays" pattern="[0-9]*" required min="1" max="365" label="Episode refresh interval (days)" />
+ <div class="fieldDescription">How often the scheduled task re-checks TMDb for newly announced unaired or missing episodes. Keeps the "Upcoming" view current for series whose local files have not changed.</div>
+ </div>
+ <div class="inputContainer inputContainer-withDescription">
+ <input is="emby-input" type="number" id="upcomingEpisodeGracePeriodDays" pattern="[0-9]*" required min="0" max="365" label="Recently aired grace period (days)" />
+ <div class="fieldDescription">When missing episodes are disabled, how many days a recently aired episode is kept in place before its placeholder is removed. This allows for the delay between an episode airing and its file being added to the library.</div>
+ </div>
+ <div class="verticalSection">
+ <h2>Libraries</h2>
+ <div class="fieldDescription" style="margin-bottom:1em;">Choose which TV libraries the unaired/missing episode options above apply to. The settings above are global; this only controls which libraries they run for. Libraries are opted in individually, so newly added libraries are not processed until they are enabled here.</div>
+ <div id="missingEpisodeLibraries"></div>
+ </div>
<div class="verticalSection">
<h2>Cast & Crew Settings</h2>
<div class="inputContainer">
@@ -85,6 +119,29 @@
Dashboard.showLoadingMsg();
var clientConfig, pluginConfig;
+ var populateMissingEpisodeLibraries = function (enabledLibraries) {
+ var container = document.querySelector('#missingEpisodeLibraries');
+ ApiClient.getVirtualFolders().then(function (folders) {
+ // Series only live in TV libraries (and mixed-content libraries, which report
+ // no collection type), so only those are worth listing here.
+ var tvLibraries = folders.filter(function (folder) {
+ return !folder.CollectionType || folder.CollectionType === 'tvshows';
+ });
+
+ if (tvLibraries.length === 0) {
+ container.innerHTML = '<div class="fieldDescription">No TV libraries found.</div>';
+ return;
+ }
+
+ container.innerHTML = tvLibraries.map(function (folder) {
+ var checked = enabledLibraries.indexOf(folder.ItemId) === -1 ? '' : ' checked';
+ return '<label class="checkboxContainer">'
+ + '<input is="emby-checkbox" type="checkbox" class="missingEpisodeLibrary" data-library-id="' + folder.ItemId + '"' + checked + ' />'
+ + '<span>' + folder.Name + '</span>'
+ + '</label>';
+ }).join('');
+ });
+ }
var configureImageScaling = function() {
if (clientConfig === undefined || pluginConfig === undefined) {
return;
@@ -151,9 +208,16 @@
document.querySelector('#excludeTagsSeries').checked = config.ExcludeTagsSeries;
document.querySelector('#excludeTagsMovies').checked = config.ExcludeTagsMovies;
document.querySelector('#importSeasonName').checked = config.ImportSeasonName;
+ document.querySelector('#importUnairedEpisodes').checked = config.ImportUnairedEpisodes;
+ document.querySelector('#importMissingEpisodes').checked = config.ImportMissingEpisodes;
+ document.querySelector('#importSpecials').checked = config.ImportSpecials;
+ document.querySelector('#missingEpisodeRefreshIntervalDays').value = config.MissingEpisodeRefreshIntervalDays;
+ document.querySelector('#upcomingEpisodeGracePeriodDays').value = config.UpcomingEpisodeGracePeriodDays;
document.querySelector('#hideMissingCastMembers').checked = config.HideMissingCastMembers;
document.querySelector('#hideMissingCrewMembers').checked = config.HideMissingCrewMembers;
+ populateMissingEpisodeLibraries(config.EnabledMissingEpisodeLibraries || []);
+
var maxCastMembers = document.querySelector('#maxCastMembers');
maxCastMembers.value = config.MaxCastMembers;
maxCastMembers.dispatchEvent(new Event('change', {
@@ -189,6 +253,17 @@
config.ExcludeTagsSeries = document.querySelector('#excludeTagsSeries').checked;
config.ExcludeTagsMovies = document.querySelector('#excludeTagsMovies').checked;
config.ImportSeasonName = document.querySelector('#importSeasonName').checked;
+ config.ImportUnairedEpisodes = document.querySelector('#importUnairedEpisodes').checked;
+ config.ImportMissingEpisodes = document.querySelector('#importMissingEpisodes').checked;
+ config.ImportSpecials = document.querySelector('#importSpecials').checked;
+ config.MissingEpisodeRefreshIntervalDays = parseInt(document.querySelector('#missingEpisodeRefreshIntervalDays').value, 10);
+ config.UpcomingEpisodeGracePeriodDays = parseInt(document.querySelector('#upcomingEpisodeGracePeriodDays').value, 10);
+ var libraryCheckboxes = document.querySelectorAll('.missingEpisodeLibrary');
+ if (libraryCheckboxes.length > 0) {
+ config.EnabledMissingEpisodeLibraries = Array.prototype.filter
+ .call(libraryCheckboxes, function (checkbox) { return checkbox.checked; })
+ .map(function (checkbox) { return checkbox.getAttribute('data-library-id'); });
+ }
config.MaxCastMembers = document.querySelector('#maxCastMembers').value;
config.MaxCrewMembers = document.querySelector('#maxCrewMembers').value;
config.HideMissingCastMembers = document.querySelector('#hideMissingCastMembers').checked;