also remove AnalyzeMovies

This commit is contained in:
Kilian von Pflugk 2024-11-24 18:21:23 +01:00
parent f20ccaed42
commit a8753a03a3
4 changed files with 28 additions and 31 deletions

View File

@ -21,11 +21,6 @@ public class PluginConfiguration : BasePluginConfiguration
// ===== Analysis settings =====
/// <summary>
/// Gets or sets a value indicating whether movies should be analyzed.
/// </summary>
public bool AnalyzeMovies { get; set; }
/// <summary>
/// Gets or sets the list of client to auto skip for.
/// </summary>
@ -300,4 +295,9 @@ public class PluginConfiguration : BasePluginConfiguration
/// Gets or sets a value indicating whether all libraries should be analyzed.
/// </summary>
public bool SelectAllLibraries { get; set; } = true;
/// <summary>
/// Gets or sets a value indicating whether movies should be analyzed.
/// </summary>
public bool AnalyzeMovies { get; set; }
}

View File

@ -55,13 +55,6 @@
</div>
</div>
<div class="checkboxContainer">
<label class="emby-checkbox-label">
<input id="AnalyzeMovies" type="checkbox" is="emby-checkbox" />
<span>Analyze Movies</span>
</label>
</div>
<div class="checkboxContainer checkboxContainer-withDescription">
<label class="emby-checkbox-label">
<input id="AnalyzeSeasonZero" type="checkbox" is="emby-checkbox" />
@ -778,7 +771,6 @@
var booleanConfigurationFields = [
"AutoDetectIntros",
"AnalyzeMovies",
"AnalyzeSeasonZero",
"UpdateMediaSegments",
"RebuildMediaSegments",
@ -823,7 +815,6 @@
var windowHashInterval = 0;
var analyzeMovies = document.getElementById("AnalyzeMovies");
var pluginSkip = document.getElementById("PluginSkip");
var serverSkipSettings = document.getElementById("ServerSkipSettings");
var autoSkip = document.getElementById("AutoSkip");
@ -930,16 +921,6 @@
pluginSkip.addEventListener("change", pluginSkipSettingChanged);
async function analyzeMoviesChanged() {
if (analyzeMovies.checked) {
movieCreditsDuration.style.display = "unset";
} else {
movieCreditsDuration.style.display = "none";
}
}
analyzeMovies.addEventListener("change", analyzeMoviesChanged);
// when the fingerprint visualizer opens, populate show names
async function visualizerToggled() {
if (!visualizer.open) {

View File

@ -247,6 +247,28 @@ internal static class LegacyMigrations
plugin.Configuration.SelectedLibraries = string.Empty;
plugin.SaveConfiguration();
}
if (!plugin.Configuration.AnalyzeMovies)
{
logger.LogInformation("Migration of your old Movie settings to Jellyfin");
foreach (var folder in libraryManager.GetVirtualFolders())
{
if (folder.CollectionType is CollectionTypeOptions.movies or CollectionTypeOptions.mixed)
{
// only add if not already disabled
if (!folder.LibraryOptions.DisabledMediaSegmentProviders.Contains(plugin.Name))
{
// ppend in case there other disabled media segment providers
folder.LibraryOptions.DisabledMediaSegmentProviders = [.. folder.LibraryOptions.DisabledMediaSegmentProviders, plugin.Name];
logger.LogInformation("Disable Media Segment Provider <{Name}> for Library <{Name}>", plugin.Name, folder.Name);
}
}
}
// reset to default
plugin.Configuration.AnalyzeMovies = true;
plugin.SaveConfiguration();
}
}
catch (Exception ex)
{

View File

@ -30,7 +30,6 @@ namespace IntroSkipper.Manager
private readonly ILogger<QueueManager> _logger = logger;
private readonly Dictionary<Guid, List<QueuedEpisode>> _queuedEpisodes = [];
private double _analysisPercent;
private bool _analyzeMovies;
/// <summary>
/// Gets all media items on the server.
@ -91,8 +90,6 @@ namespace IntroSkipper.Manager
// Store the analysis percent
_analysisPercent = Convert.ToDouble(config.AnalysisPercent) / 100;
_analyzeMovies = config.AnalyzeMovies;
// If analysis settings have been changed from the default, log the modified settings.
if (config.AnalysisLengthLimit != 10 || config.AnalysisPercent != 25 || config.MinimumIntroDuration != 15)
{
@ -137,10 +134,7 @@ namespace IntroSkipper.Manager
}
else if (item is Movie movie)
{
if (_analyzeMovies)
{
QueueMovie(movie);
}
QueueMovie(movie);
}
else
{