Add a wrapper for media segments

pending approval from Jellyfin
This commit is contained in:
TwistedUmbrellaX 2024-03-05 09:12:57 -05:00
parent 88ca573144
commit a90175dd66
2 changed files with 38 additions and 2 deletions

View File

@ -275,10 +275,10 @@ public class ChromaprintAnalyzer : IMediaFileAnalyzer
{ {
var modifiedPoint = (uint)(originalPoint + i); 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 lhsFirst = (int)lhsIndex[originalPoint];
var rhsFirst = (int)value; var rhsFirst = (int)rhsModifiedPoint;
indexShifts.Add(rhsFirst - lhsFirst); indexShifts.Add(rhsFirst - lhsFirst);
} }
} }

View File

@ -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;
/// <summary>
/// Chapter name analyzer.
/// </summary>
public class SegmentAnalyzer : IMediaFileAnalyzer
{
private ILogger<SegmentAnalyzer> _logger;
/// <summary>
/// Initializes a new instance of the <see cref="SegmentAnalyzer"/> class.
/// </summary>
/// <param name="logger">Logger.</param>
public SegmentAnalyzer(ILogger<SegmentAnalyzer> logger)
{
_logger = logger;
}
/// <inheritdoc />
public ReadOnlyCollection<QueuedEpisode> AnalyzeMediaFiles(
ReadOnlyCollection<QueuedEpisode> analysisQueue,
AnalysisMode mode,
CancellationToken cancellationToken)
{
return analysisQueue;
}
}