Add Track Number support and make Cancel async
This commit is contained in:
parent
ae6c2afb30
commit
4658afdc20
9 changed files with 29 additions and 21 deletions
|
|
@ -1,6 +1,7 @@
|
|||
using LibationFileManager;
|
||||
using NAudio.Lame;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FileLiberator
|
||||
{
|
||||
|
|
@ -12,7 +13,7 @@ namespace FileLiberator
|
|||
public event EventHandler<string> AuthorsDiscovered;
|
||||
public event EventHandler<string> NarratorsDiscovered;
|
||||
public event EventHandler<byte[]> CoverImageDiscovered;
|
||||
public abstract void Cancel();
|
||||
public abstract Task CancelAsync();
|
||||
|
||||
protected LameConfig GetLameOptions(Configuration config)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,10 +19,7 @@ namespace FileLiberator
|
|||
private long fileSize;
|
||||
private static string Mp3FileName(string m4bPath) => Path.ChangeExtension(m4bPath ?? "", ".mp3");
|
||||
|
||||
public override void Cancel()
|
||||
{
|
||||
m4bBook?.Cancel();
|
||||
}
|
||||
public override Task CancelAsync() => m4bBook?.CancelAsync();
|
||||
|
||||
public static bool ValidateMp3(LibraryBook libraryBook)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ namespace FileLiberator
|
|||
|
||||
public override bool Validate(LibraryBook libraryBook) => !libraryBook.Book.Audio_Exists();
|
||||
|
||||
public override void Cancel() => abDownloader?.Cancel();
|
||||
public override Task CancelAsync() => abDownloader?.CancelAsync();
|
||||
|
||||
public override async Task<StatusHandler> ProcessAsync(LibraryBook libraryBook)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue