Rename files

This commit is contained in:
ConfusedPolarBear 2022-06-09 17:33:39 -05:00
parent 4b99c934b4
commit 55e04efb8d
5 changed files with 9 additions and 13 deletions

View File

@ -7,14 +7,12 @@ using Microsoft.Extensions.Logging;
namespace ConfusedPolarBear.Plugin.IntroSkipper.Tests;
// TODO: rename
public class TestFPCalc
public class TestAudioFingerprinting
{
[Fact]
public void TestInstallationCheck()
{
Assert.True(FPCalc.CheckFFmpegVersion());
Assert.True(Chromaprint.CheckFFmpegVersion());
}
[Theory]
@ -58,7 +56,7 @@ public class TestFPCalc
3472417825, 3395841056, 3458735136, 3341420624, 1076496560, 1076501168, 1076501136, 1076497024
};
var actual = FPCalc.Fingerprint(queueEpisode("audio/big_buck_bunny_intro.mp3"));
var actual = Chromaprint.Fingerprint(queueEpisode("audio/big_buck_bunny_intro.mp3"));
Assert.Equal(expected, actual);
}

View File

@ -7,14 +7,12 @@ using System.IO;
using System.Text;
using Microsoft.Extensions.Logging;
// TODO: rename
namespace ConfusedPolarBear.Plugin.IntroSkipper;
/// <summary>
/// Wrapper for libchromaprint.
/// </summary>
public static class FPCalc
public static class Chromaprint
{
/// <summary>
/// Gets or sets the logger.

View File

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

View File

@ -49,10 +49,10 @@ public class Entrypoint : IServerEntryPoint
/// <returns>Task.</returns>
public Task RunAsync()
{
FPCalc.Logger = _logger;
Chromaprint.Logger = _logger;
// Assert that ffmpeg with chromaprint is installed
if (!FPCalc.CheckFFmpegVersion())
if (!Chromaprint.CheckFFmpegVersion())
{
_logger.LogError("ffmpeg with chromaprint is not installed on this system - episodes will not be analyzed");
return Task.CompletedTask;

View File

@ -274,8 +274,8 @@ public class FingerprinterTask : IScheduledTask
/// <returns>Intros for the first and second episodes.</returns>
public (Intro Lhs, Intro Rhs) FingerprintEpisodes(QueuedEpisode lhsEpisode, QueuedEpisode rhsEpisode)
{
var lhsFingerprint = FPCalc.Fingerprint(lhsEpisode);
var rhsFingerprint = FPCalc.Fingerprint(rhsEpisode);
var lhsFingerprint = Chromaprint.Fingerprint(lhsEpisode);
var rhsFingerprint = Chromaprint.Fingerprint(rhsEpisode);
// Cache the fingerprints for quicker recall in the second pass (if one is needed).
lock (_fingerprintCacheLock)