Update AAXClean

This commit is contained in:
Mbucari 2023-08-27 19:47:32 -06:00
parent f86c77a546
commit 42a93bfac1
4 changed files with 12 additions and 25 deletions

View File

@ -13,7 +13,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AAXClean.Codecs" Version="1.1.0" />
<PackageReference Include="AAXClean.Codecs" Version="1.1.1" />
</ItemGroup>
<ItemGroup>

View File

@ -60,6 +60,11 @@ namespace FileLiberator
config.LameMatchSourceBR,
chapters);
if (m4bBook.AppleTags.Tracks is (int trackNum, int trackCount))
{
lameConfig.ID3.Track = trackCount > 0 ? $"{trackNum}/{trackCount}" : trackNum.ToString();
}
using var mp3File = File.Open(Path.GetTempFileName(), FileMode.OpenOrCreate, FileAccess.ReadWrite);
try
{

View File

@ -170,21 +170,19 @@ namespace LibationFileManager
try
{
using var fileStream = File.OpenRead(path);
if (format is OutputFormat.M4b)
{
var mp4File = await Task.Run(() => new AAXClean.Mp4File(fileStream), cancellationToken);
var tags = await Task.Run(() => AAXClean.AppleTags.FromFile(path));
if (mp4File?.AppleTags?.Asin is not null)
audioFile = new FilePathCache.CacheEntry(mp4File.AppleTags.Asin, FileType.Audio, path);
if (tags?.Asin is not null)
audioFile = new FilePathCache.CacheEntry(tags.Asin, FileType.Audio, path);
}
else
{
var id3 = NAudio.Lame.ID3.Id3Tag.Create(fileStream);
using var fileStream = File.OpenRead(path);
var id3 = await Task.Run(() => NAudio.Lame.ID3.Id3Tag.Create(fileStream));
var asin
= id3?.Children
var asin = id3?.Children
.OfType<NAudio.Lame.ID3.TXXXFrame>()
.FirstOrDefault(f => f.FieldName == "AUDIBLE_ASIN")
?.FieldValue;

View File

@ -95,20 +95,4 @@ public class GridContextMenu
return TemplateEditor<T>.CreateFilenameEditor(Configuration.Instance.Books, existingTemplate, folderDto, fileDto);
}
}
class Command : ICommand
{
public event EventHandler CanExecuteChanged;
public bool CanExecute(object parameter)
{
throw new NotImplementedException();
}
public void Execute(object parameter)
{
throw new NotImplementedException();
}
}