From a90175dd6688ae1a10ecb7bf883f8cf0d6c50d9d Mon Sep 17 00:00:00 2001 From: TwistedUmbrellaX Date: Tue, 5 Mar 2024 09:12:57 -0500 Subject: [PATCH] Add a wrapper for media segments pending approval from Jellyfin --- .../Analyzers/ChromaprintAnalyzer.cs | 4 +-- .../Analyzers/SegmentAnalyzer.cs | 36 +++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 ConfusedPolarBear.Plugin.IntroSkipper/Analyzers/SegmentAnalyzer.cs diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Analyzers/ChromaprintAnalyzer.cs b/ConfusedPolarBear.Plugin.IntroSkipper/Analyzers/ChromaprintAnalyzer.cs index 2a03321..c2eb513 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Analyzers/ChromaprintAnalyzer.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Analyzers/ChromaprintAnalyzer.cs @@ -275,10 +275,10 @@ public class ChromaprintAnalyzer : IMediaFileAnalyzer { var modifiedPoint = (uint)(originalPoint + i); - if (rhsIndex.TryGetValue(modifiedPoint, out var value)) + if (rhsIndex.TryGetValue(modifiedPoint, out var rhsModifiedPoint)) { var lhsFirst = (int)lhsIndex[originalPoint]; - var rhsFirst = (int)value; + var rhsFirst = (int)rhsModifiedPoint; indexShifts.Add(rhsFirst - lhsFirst); } } diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Analyzers/SegmentAnalyzer.cs b/ConfusedPolarBear.Plugin.IntroSkipper/Analyzers/SegmentAnalyzer.cs new file mode 100644 index 0000000..da17352 --- /dev/null +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Analyzers/SegmentAnalyzer.cs @@ -0,0 +1,36 @@ +namespace ConfusedPolarBear.Plugin.IntroSkipper; + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Globalization; +using System.Linq; +using System.Threading; +using MediaBrowser.Model.Entities; +using Microsoft.Extensions.Logging; + +/// +/// Chapter name analyzer. +/// +public class SegmentAnalyzer : IMediaFileAnalyzer +{ + private ILogger _logger; + + /// + /// Initializes a new instance of the class. + /// + /// Logger. + public SegmentAnalyzer(ILogger logger) + { + _logger = logger; + } + + /// + public ReadOnlyCollection AnalyzeMediaFiles( + ReadOnlyCollection analysisQueue, + AnalysisMode mode, + CancellationToken cancellationToken) + { + return analysisQueue; + } +}