diff --git a/Directory.Build.props b/Directory.Build.props index 1c1ef57..0eed910 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - net8.0 + net9.0 preview enable enable diff --git a/src/SongProcessor.UI/Converters/MiscConverters.cs b/src/SongProcessor.UI/Converters/MiscConverters.cs index 36c91e7..a331fb6 100644 --- a/src/SongProcessor.UI/Converters/MiscConverters.cs +++ b/src/SongProcessor.UI/Converters/MiscConverters.cs @@ -36,7 +36,7 @@ public static class MiscConverters { return _Cyan; } - if ((x & Status.None) != 0) + if ((x & Status.Submitted) != 0) { return _Yellow; } diff --git a/src/SongProcessor/Gatherers/GathererUtils.cs b/src/SongProcessor/Gatherers/GathererUtils.cs index f0a2c28..ddc1a54 100644 --- a/src/SongProcessor/Gatherers/GathererUtils.cs +++ b/src/SongProcessor/Gatherers/GathererUtils.cs @@ -4,7 +4,7 @@ namespace SongProcessor.Gatherers; public static class GathererUtils { - public static HttpClient DefaultGathererClient => field ??= CreateClient(); + public static HttpClient DefaultGathererClient { get; } = CreateClient(); public static FormatException InvalidPropertyProvided( this IAnimeGatherer gatherer, diff --git a/src/SongProcessor/Models/Status.cs b/src/SongProcessor/Models/Status.cs index 5db3ace..3c8d66e 100644 --- a/src/SongProcessor/Models/Status.cs +++ b/src/SongProcessor/Models/Status.cs @@ -4,8 +4,7 @@ public enum Status : uint { NotSubmitted = 0, - None = 1U << 0, - Submitted = None, + Submitted = 1U << 0, Mp3 = 1U << 1, Res480 = 1U << 2, Res720 = 1U << 3, diff --git a/src/SongProcessor/Program.cs b/src/SongProcessor/Program.cs index 140008a..b8ade99 100644 --- a/src/SongProcessor/Program.cs +++ b/src/SongProcessor/Program.cs @@ -44,7 +44,7 @@ private static void Display(IEnumerable anime) static void DisplayStatusItems(Status status) { - const Status ALL = Status.None | Status.Mp3 | Status.Res480 | Status.Res720; + const Status ALL = Status.Submitted | Status.Mp3 | Status.Res480 | Status.Res720; static void DisplayStatusItem(Status status, Status item, string rep) { diff --git a/tests/SongProcessor.Tests/FFmpeg/Jobs/VideoSongJob_Tests.cs b/tests/SongProcessor.Tests/FFmpeg/Jobs/VideoSongJob_Tests.cs index a2e7c14..d4444bf 100644 --- a/tests/SongProcessor.Tests/FFmpeg/Jobs/VideoSongJob_Tests.cs +++ b/tests/SongProcessor.Tests/FFmpeg/Jobs/VideoSongJob_Tests.cs @@ -179,7 +179,7 @@ public async Task ProcessVideo_Test() var file = await GetSingleFileProducedAsync(temp.Dir, job).ConfigureAwait(false); var newVideoInfo = await Gatherer.GetVideoInfoAsync(file).ConfigureAwait(false); - AssertValidLength(job, newVideoInfo); + AssertValidLength(job, newVideoInfo!); job.AlreadyExists.Should().BeTrue(); var result = await job.ProcessAsync().ConfigureAwait(false); @@ -217,7 +217,7 @@ public async Task ProcessVideoComplicated_Test() // Create a duplicate version to treat as a clean version var cleanPath = await GetSingleFileProducedAsync(temp.Dir, job).ConfigureAwait(false); var cleanVideoInfo = await Gatherer.GetVideoInfoAsync(cleanPath).ConfigureAwait(false); - AssertValidLength(job, cleanVideoInfo); + AssertValidLength(job, cleanVideoInfo!); { var movedPath = Path.Combine( @@ -241,11 +241,11 @@ public async Task ProcessVideoComplicated_Test() var file = GetSingleFile(temp.Dir); var newVolumeInfo = await Gatherer.GetVolumeInfoAsync(file).ConfigureAwait(false); - newVolumeInfo.MaxVolume.Should().BeLessThan(VolumeInfo.MaxVolume); + newVolumeInfo!.MaxVolume.Should().BeLessThan(VolumeInfo.MaxVolume); newVolumeInfo.MeanVolume.Should().BeLessThan(VolumeInfo.MeanVolume); var newVideoInfo = await Gatherer.GetVideoInfoAsync(file).ConfigureAwait(false); - AssertValidLength(job, newVideoInfo); + AssertValidLength(job, newVideoInfo!); } protected override Anime CreateAnime(string directory)