Rename {Chromaprint,FFmpegWrapper}.cs

This commit is contained in:
ConfusedPolarBear 2022-08-28 22:35:43 -05:00
parent bbed34b0e7
commit fb6cd5c1d7
7 changed files with 14 additions and 14 deletions

View File

@ -14,7 +14,7 @@ public class TestAudioFingerprinting
[FactSkipFFmpegTests]
public void TestInstallationCheck()
{
Assert.True(Chromaprint.CheckFFmpegVersion());
Assert.True(FFmpegWrapper.CheckFFmpegVersion());
}
[Theory]
@ -58,7 +58,7 @@ public class TestAudioFingerprinting
3472417825, 3395841056, 3458735136, 3341420624, 1076496560, 1076501168, 1076501136, 1076497024
};
var actual = Chromaprint.Fingerprint(queueEpisode("audio/big_buck_bunny_intro.mp3"));
var actual = FFmpegWrapper.Fingerprint(queueEpisode("audio/big_buck_bunny_intro.mp3"));
Assert.Equal(expected, actual);
}
@ -78,7 +78,7 @@ public class TestAudioFingerprinting
{77, 5},
};
var actual = Chromaprint.CreateInvertedIndex(Guid.NewGuid(), fpr);
var actual = FFmpegWrapper.CreateInvertedIndex(Guid.NewGuid(), fpr);
Assert.Equal(expected, actual);
}
@ -90,8 +90,8 @@ public class TestAudioFingerprinting
var lhsEpisode = queueEpisode("audio/big_buck_bunny_intro.mp3");
var rhsEpisode = queueEpisode("audio/big_buck_bunny_clip.mp3");
var lhsFingerprint = Chromaprint.Fingerprint(lhsEpisode);
var rhsFingerprint = Chromaprint.Fingerprint(rhsEpisode);
var lhsFingerprint = FFmpegWrapper.Fingerprint(lhsEpisode);
var rhsFingerprint = FFmpegWrapper.Fingerprint(rhsEpisode);
var (lhs, rhs) = task.CompareEpisodes(
lhsEpisode.EpisodeId,

View File

@ -58,7 +58,7 @@ public class TroubleshootingController : ControllerBase
bundle.Append(" seasons");
bundle.Append('\n');
bundle.Append(Chromaprint.GetChromaprintLogs());
bundle.Append(FFmpegWrapper.GetChromaprintLogs());
return bundle.ToString();
}

View File

@ -113,7 +113,7 @@ public class VisualizationController : ControllerBase
{
if (needle.EpisodeId == id)
{
return Chromaprint.Fingerprint(needle);
return FFmpegWrapper.Fingerprint(needle);
}
}
}

View File

@ -46,7 +46,7 @@ public class Entrypoint : IServerEntryPoint
/// <returns>Task.</returns>
public Task RunAsync()
{
Chromaprint.Logger = _logger;
FFmpegWrapper.Logger = _logger;
#if DEBUG
LogVersion();

View File

@ -9,9 +9,9 @@ using Microsoft.Extensions.Logging;
namespace ConfusedPolarBear.Plugin.IntroSkipper;
/// <summary>
/// Wrapper for libchromaprint.
/// Wrapper for libchromaprint and the silencedetect filter.
/// </summary>
public static class Chromaprint
public static class FFmpegWrapper
{
/// <summary>
/// Gets or sets the logger.

View File

@ -40,7 +40,7 @@ public class QueueManager
public void EnqueueAllEpisodes()
{
// Assert that ffmpeg with chromaprint is installed
if (!Chromaprint.CheckFFmpegVersion())
if (!FFmpegWrapper.CheckFFmpegVersion())
{
throw new FingerprintException(
"ffmpeg with chromaprint is not installed on this system - episodes will not be analyzed. If Jellyfin is running natively, install jellyfin-ffmpeg5. If Jellyfin is running in a container, upgrade it to the latest version of 10.8.0.");

View File

@ -269,7 +269,7 @@ public class AnalyzeEpisodesTask : IScheduledTask
{
try
{
fingerprintCache[episode.EpisodeId] = Chromaprint.Fingerprint(episode);
fingerprintCache[episode.EpisodeId] = FFmpegWrapper.Fingerprint(episode);
}
catch (FingerprintException ex)
{
@ -436,8 +436,8 @@ public class AnalyzeEpisodesTask : IScheduledTask
var rhsRanges = new List<TimeRange>();
// Generate inverted indexes for the left and right episodes.
var lhsIndex = Chromaprint.CreateInvertedIndex(lhsId, lhsPoints);
var rhsIndex = Chromaprint.CreateInvertedIndex(rhsId, rhsPoints);
var lhsIndex = FFmpegWrapper.CreateInvertedIndex(lhsId, lhsPoints);
var rhsIndex = FFmpegWrapper.CreateInvertedIndex(rhsId, rhsPoints);
var indexShifts = new HashSet<int>();
// For all audio points in the left episode, check if the right episode has a point which matches exactly.