diff --git a/AaxDecrypter/AaxcDownloadConverter.cs b/AaxDecrypter/AaxcDownloadConverter.cs index 28192d07..0fa7606b 100644 --- a/AaxDecrypter/AaxcDownloadConverter.cs +++ b/AaxDecrypter/AaxcDownloadConverter.cs @@ -7,7 +7,7 @@ using System.IO; namespace AaxDecrypter { - public class AaxcDownloadConverter : AudioDownloadBase + public class AaxcDownloadConverter : AudiobookDownloadBase { protected override StepSequence steps { get; } diff --git a/AaxDecrypter/AudioDownloadBase.cs b/AaxDecrypter/AudiobookDownloadBase.cs similarity index 97% rename from AaxDecrypter/AudioDownloadBase.cs rename to AaxDecrypter/AudiobookDownloadBase.cs index 2792265d..7a2425d4 100644 --- a/AaxDecrypter/AudioDownloadBase.cs +++ b/AaxDecrypter/AudiobookDownloadBase.cs @@ -13,7 +13,7 @@ namespace AaxDecrypter { public enum OutputFormat { M4b, Mp3 } - public abstract class AudioDownloadBase + public abstract class AudiobookDownloadBase { public event EventHandler RetrievedTitle; public event EventHandler RetrievedAuthors; @@ -37,7 +37,7 @@ namespace AaxDecrypter private string jsonDownloadState => Path.Combine(cacheDir, Path.GetFileNameWithoutExtension(outputFileName) + ".json"); private string tempFile => PathLib.ReplaceExtension(jsonDownloadState, ".tmp"); - public AudioDownloadBase(string outFileName, string cacheDirectory, DownloadLicense dlLic) + public AudiobookDownloadBase(string outFileName, string cacheDirectory, DownloadLicense dlLic) { AppName = GetType().Name; diff --git a/AaxDecrypter/Mp3Downloader.cs b/AaxDecrypter/Mp3AudiobookDownloader.cs similarity index 92% rename from AaxDecrypter/Mp3Downloader.cs rename to AaxDecrypter/Mp3AudiobookDownloader.cs index 72265d3c..d0dfe48e 100644 --- a/AaxDecrypter/Mp3Downloader.cs +++ b/AaxDecrypter/Mp3AudiobookDownloader.cs @@ -8,11 +8,11 @@ using System.Threading; namespace AaxDecrypter { - public class Mp3Downloader : AudioDownloadBase + public class Mp3AudiobookDownloader : AudiobookDownloadBase { protected override StepSequence steps { get; } - public Mp3Downloader(string outFileName, string cacheDirectory, DownloadLicense dlLic) + public Mp3AudiobookDownloader(string outFileName, string cacheDirectory, DownloadLicense dlLic) : base(outFileName, cacheDirectory, dlLic) { diff --git a/FileLiberator/DownloadDecryptBook.cs b/FileLiberator/DownloadDecryptBook.cs index 8ef3e189..9cf43a88 100644 --- a/FileLiberator/DownloadDecryptBook.cs +++ b/FileLiberator/DownloadDecryptBook.cs @@ -15,7 +15,7 @@ namespace FileLiberator { public class DownloadDecryptBook : IAudioDecodable { - private AudioDownloadBase aaxcDownloader; + private AudiobookDownloadBase aaxcDownloader; public event EventHandler StreamingTimeRemaining; public event EventHandler> RequestCoverArt; @@ -54,7 +54,7 @@ namespace FileLiberator if (libraryBook.Book.Audio_Exists) return new StatusHandler { "Cannot find decrypt. Final audio file already exists" }; - var outputAudioFilename = await aaxToM4bConverterDecryptAsync(AudibleFileStorage.DownloadsInProgress, AudibleFileStorage.DecryptInProgress, libraryBook); + var outputAudioFilename = await downloadAudiobookAsync(AudibleFileStorage.DownloadsInProgress, AudibleFileStorage.DecryptInProgress, libraryBook); // decrypt failed if (outputAudioFilename is null) @@ -76,7 +76,7 @@ namespace FileLiberator } } - private async Task aaxToM4bConverterDecryptAsync(string cacheDir, string destinationDir, LibraryBook libraryBook) + private async Task downloadAudiobookAsync(string cacheDir, string destinationDir, LibraryBook libraryBook) { StreamingBegin?.Invoke(this, $"Begin decrypting {libraryBook}"); @@ -112,7 +112,7 @@ namespace FileLiberator var outFileName = Path.Combine(destinationDir, $"{PathLib.ToPathSafeString(libraryBook.Book.Title)} [{libraryBook.Book.AudibleProductId}].{outputFormat.ToString().ToLower()}"); - aaxcDownloader = contentLic.DrmType == AudibleApi.Common.DrmType.Adrm ? new AaxcDownloadConverter(outFileName, cacheDir, aaxcDecryptDlLic, outputFormat) { AppName = "Libation" } : new Mp3Downloader(outFileName, cacheDir, aaxcDecryptDlLic); + aaxcDownloader = contentLic.DrmType == AudibleApi.Common.DrmType.Adrm ? new AaxcDownloadConverter(outFileName, cacheDir, aaxcDecryptDlLic, outputFormat) { AppName = "Libation" } : new Mp3AudiobookDownloader(outFileName, cacheDir, aaxcDecryptDlLic); aaxcDownloader.DecryptProgressUpdate += (s, progress) => StreamingProgressChanged?.Invoke(this, progress); aaxcDownloader.DecryptTimeRemaining += (s, remaining) => StreamingTimeRemaining?.Invoke(this, remaining); aaxcDownloader.RetrievedTitle += (s, title) => TitleDiscovered?.Invoke(this, title);