Merge pull request #128 from RepoDevil/10.8

Attempt to verify queue when finishing
This commit is contained in:
TwistedUmbrellaX 2024-04-26 19:43:01 -04:00 committed by GitHub
commit f2eae80c54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 1 deletions

View File

@ -91,7 +91,9 @@ public class ChapterAnalyzer : IMediaFileAnalyzer
var config = Plugin.Instance?.Configuration ?? new Configuration.PluginConfiguration();
var minDuration = config.MinimumIntroDuration;
var minDuration = mode == AnalysisMode.Introduction ?
config.MinimumIntroDuration :
config.MinimumCreditsDuration;
int maxDuration = mode == AnalysisMode.Introduction ?
config.MaximumIntroDuration :
config.MaximumCreditsDuration;

View File

@ -98,6 +98,20 @@ public class BaseItemAnalyzerTask
{
var writeEdl = false;
var totalRemaining = (Plugin.Instance!.TotalQueued * modeCount) - totalProcessed;
if (totalRemaining >= queue.Count * modeCount)
{
queue = new(Plugin.Instance!.QueuedMediaItems);
totalQueued = 0;
foreach (var kvp in queue)
{
totalQueued += kvp.Value.Count;
}
totalQueued *= _analysisModes.Count;
}
// Since the first run of the task can run for multiple hours, ensure that none
// of the current media items were deleted from Jellyfin since the task was started.
var (episodes, requiredModes) = queueManager.VerifyQueue(