Skip to content

Commit

Permalink
Update AAXClean
Browse files Browse the repository at this point in the history
  • Loading branch information
Mbucari committed Jan 19, 2023
1 parent c34788d commit abc7d94
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 27 deletions.
36 changes: 13 additions & 23 deletions src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,36 +66,31 @@ public static async Task<int> Main(string[] args)
}



aaxFile.ConversionProgressUpdate += AaxFile_ConversionProgressUpdate;

DateTime startTime = DateTime.Now;
int chNum = 1;
var result
var operation
= aaxConversionOptions.SplitFileByChapters
? await aaxFile.ConvertToMultiMp4aAsync(chapters ?? aaxFile.GetChaptersFromMetadata(), cb => cb.OutputFile = aaxConversionOptions.GetOutputStream(chNum++))
: await aaxFile.ConvertToMp4aAsync(aaxConversionOptions.GetOutputStream(), chapters);
? aaxFile.ConvertToMultiMp4aAsync(chapters ?? aaxFile.GetChaptersFromMetadata(), cb => cb.OutputFile = aaxConversionOptions.GetOutputStream(chNum++))
: aaxFile.ConvertToMp4aAsync(aaxConversionOptions.GetOutputStream(), chapters);

operation.ConversionProgressUpdate += AaxFile_ConversionProgressUpdate;

await operation;

var duration = DateTime.Now - startTime;


ConsoleText.WriteLine();
WriteColoredLine(
("\r\nConversion succeeded!", ConsoleColor.Green),
($" Total time: {duration:mm\\:ss\\.ff}", ConsoleColor.White));

if (result == ConversionResult.Failed)
{
WriteColoredLine(("Conversion Failed!", ConsoleColor.Red));
return await Task.FromResult(-2);
}
else
{
WriteColoredLine(
("\r\nConversion succeeded!", ConsoleColor.Green),
($" Total time: {duration:mm\\:ss\\.ff}", ConsoleColor.White));
return 0;

return await Task.FromResult(0);
}
}
catch (Exception ex)
{
ConsoleText.WriteLine();
WriteColoredLine(
("Error Converting Book", ConsoleColor.Red),
(": ", ConsoleColor.White),
Expand All @@ -105,11 +100,6 @@ var result
}
}

private static void NewSplitCallback(NewSplitCallback newSplit)
{

}

private static void ListChapters(string prefix, AAXClean.ChapterInfo chInfo)
{
if (chInfo is null)
Expand Down
9 changes: 5 additions & 4 deletions src/aaxclean-cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>aaxclean_cli</RootNamespace>
<Version>0.1.5</Version>
<Version>0.1.6</Version>
<Authors>MrGneissGuy</Authors>
<Company>Just Me, Inc.</Company>
<Description>Command line interface for AAXClean</Description>
Expand All @@ -22,9 +22,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AAXClean" Version="0.4.9" />
<PackageReference Include="CommandLineArgumentsParser" Version="3.0.22" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />

<PackageReference Include="AAXClean" Version="0.5.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>

</Project>

0 comments on commit abc7d94

Please sign in to comment.