Rename files
This commit is contained in:
parent
4b99c934b4
commit
55e04efb8d
@ -7,14 +7,12 @@ using Microsoft.Extensions.Logging;
|
|||||||
|
|
||||||
namespace ConfusedPolarBear.Plugin.IntroSkipper.Tests;
|
namespace ConfusedPolarBear.Plugin.IntroSkipper.Tests;
|
||||||
|
|
||||||
// TODO: rename
|
public class TestAudioFingerprinting
|
||||||
|
|
||||||
public class TestFPCalc
|
|
||||||
{
|
{
|
||||||
[Fact]
|
[Fact]
|
||||||
public void TestInstallationCheck()
|
public void TestInstallationCheck()
|
||||||
{
|
{
|
||||||
Assert.True(FPCalc.CheckFFmpegVersion());
|
Assert.True(Chromaprint.CheckFFmpegVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
@ -58,7 +56,7 @@ public class TestFPCalc
|
|||||||
3472417825, 3395841056, 3458735136, 3341420624, 1076496560, 1076501168, 1076501136, 1076497024
|
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);
|
Assert.Equal(expected, actual);
|
||||||
}
|
}
|
||||||
|
@ -7,14 +7,12 @@ using System.IO;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
// TODO: rename
|
|
||||||
|
|
||||||
namespace ConfusedPolarBear.Plugin.IntroSkipper;
|
namespace ConfusedPolarBear.Plugin.IntroSkipper;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Wrapper for libchromaprint.
|
/// Wrapper for libchromaprint.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class FPCalc
|
public static class Chromaprint
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the logger.
|
/// Gets or sets the logger.
|
@ -105,7 +105,7 @@ public class VisualizationController : ControllerBase
|
|||||||
{
|
{
|
||||||
if (needle.EpisodeId == id)
|
if (needle.EpisodeId == id)
|
||||||
{
|
{
|
||||||
return FPCalc.Fingerprint(needle);
|
return Chromaprint.Fingerprint(needle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,10 +49,10 @@ public class Entrypoint : IServerEntryPoint
|
|||||||
/// <returns>Task.</returns>
|
/// <returns>Task.</returns>
|
||||||
public Task RunAsync()
|
public Task RunAsync()
|
||||||
{
|
{
|
||||||
FPCalc.Logger = _logger;
|
Chromaprint.Logger = _logger;
|
||||||
|
|
||||||
// Assert that ffmpeg with chromaprint is installed
|
// 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");
|
_logger.LogError("ffmpeg with chromaprint is not installed on this system - episodes will not be analyzed");
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
|
@ -274,8 +274,8 @@ public class FingerprinterTask : IScheduledTask
|
|||||||
/// <returns>Intros for the first and second episodes.</returns>
|
/// <returns>Intros for the first and second episodes.</returns>
|
||||||
public (Intro Lhs, Intro Rhs) FingerprintEpisodes(QueuedEpisode lhsEpisode, QueuedEpisode rhsEpisode)
|
public (Intro Lhs, Intro Rhs) FingerprintEpisodes(QueuedEpisode lhsEpisode, QueuedEpisode rhsEpisode)
|
||||||
{
|
{
|
||||||
var lhsFingerprint = FPCalc.Fingerprint(lhsEpisode);
|
var lhsFingerprint = Chromaprint.Fingerprint(lhsEpisode);
|
||||||
var rhsFingerprint = FPCalc.Fingerprint(rhsEpisode);
|
var rhsFingerprint = Chromaprint.Fingerprint(rhsEpisode);
|
||||||
|
|
||||||
// Cache the fingerprints for quicker recall in the second pass (if one is needed).
|
// Cache the fingerprints for quicker recall in the second pass (if one is needed).
|
||||||
lock (_fingerprintCacheLock)
|
lock (_fingerprintCacheLock)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user