Skip to content

Commit

Permalink
Removed Status.None since it was confusing.
Browse files Browse the repository at this point in the history
  • Loading branch information
natekford committed Jan 2, 2025
1 parent c1e85ef commit a482a28
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>preview</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand Down
2 changes: 1 addition & 1 deletion src/SongProcessor.UI/Converters/MiscConverters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static class MiscConverters
{
return _Cyan;
}
if ((x & Status.None) != 0)
if ((x & Status.Submitted) != 0)
{
return _Yellow;
}
Expand Down
2 changes: 1 addition & 1 deletion src/SongProcessor/Gatherers/GathererUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions src/SongProcessor/Models/Status.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/SongProcessor/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private static void Display(IEnumerable<IAnime> 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)
{
Expand Down
8 changes: 4 additions & 4 deletions tests/SongProcessor.Tests/FFmpeg/Jobs/VideoSongJob_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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(
Expand All @@ -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)
Expand Down

0 comments on commit a482a28

Please sign in to comment.