From 55e04efb8d1ea83482f2639d3428ef38e783bbc2 Mon Sep 17 00:00:00 2001 From: ConfusedPolarBear <33811686+ConfusedPolarBear@users.noreply.github.com> Date: Thu, 9 Jun 2022 17:33:39 -0500 Subject: [PATCH] Rename files --- .../TestAudioFingerprinting.cs | 8 +++----- .../{FPCalc.cs => Chromaprint.cs} | 4 +--- .../Controllers/VisualizationController.cs | 2 +- ConfusedPolarBear.Plugin.IntroSkipper/Entrypoint.cs | 4 ++-- .../ScheduledTasks/FingerprinterTask.cs | 4 ++-- 5 files changed, 9 insertions(+), 13 deletions(-) rename ConfusedPolarBear.Plugin.IntroSkipper/{FPCalc.cs => Chromaprint.cs} (99%) diff --git a/ConfusedPolarBear.Plugin.IntroSkipper.Tests/TestAudioFingerprinting.cs b/ConfusedPolarBear.Plugin.IntroSkipper.Tests/TestAudioFingerprinting.cs index fbf6076..adf5835 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper.Tests/TestAudioFingerprinting.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper.Tests/TestAudioFingerprinting.cs @@ -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); } diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/FPCalc.cs b/ConfusedPolarBear.Plugin.IntroSkipper/Chromaprint.cs similarity index 99% rename from ConfusedPolarBear.Plugin.IntroSkipper/FPCalc.cs rename to ConfusedPolarBear.Plugin.IntroSkipper/Chromaprint.cs index 7deba7c..b6fc43e 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/FPCalc.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Chromaprint.cs @@ -7,14 +7,12 @@ using System.IO; using System.Text; using Microsoft.Extensions.Logging; -// TODO: rename - namespace ConfusedPolarBear.Plugin.IntroSkipper; /// /// Wrapper for libchromaprint. /// -public static class FPCalc +public static class Chromaprint { /// /// Gets or sets the logger. diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Controllers/VisualizationController.cs b/ConfusedPolarBear.Plugin.IntroSkipper/Controllers/VisualizationController.cs index c92b919..c179c54 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Controllers/VisualizationController.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Controllers/VisualizationController.cs @@ -105,7 +105,7 @@ public class VisualizationController : ControllerBase { if (needle.EpisodeId == id) { - return FPCalc.Fingerprint(needle); + return Chromaprint.Fingerprint(needle); } } } diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Entrypoint.cs b/ConfusedPolarBear.Plugin.IntroSkipper/Entrypoint.cs index c3df4f1..a1f2cc4 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Entrypoint.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Entrypoint.cs @@ -49,10 +49,10 @@ public class Entrypoint : IServerEntryPoint /// Task. 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; diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/FingerprinterTask.cs b/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/FingerprinterTask.cs index c674822..c8c71d1 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/FingerprinterTask.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/FingerprinterTask.cs @@ -274,8 +274,8 @@ public class FingerprinterTask : IScheduledTask /// Intros for the first and second episodes. 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)