diff --git a/AaxDecrypter/AaxcDownloadConverter.cs b/AaxDecrypter/AaxcDownloadConverter.cs index a261ce06..e587ebed 100644 --- a/AaxDecrypter/AaxcDownloadConverter.cs +++ b/AaxDecrypter/AaxcDownloadConverter.cs @@ -25,8 +25,12 @@ namespace AaxDecrypter Name = "Download and Convert Aaxc To " + OutputFormat, ["Step 1: Get Aaxc Metadata"] = Step1_GetMetadata, - ["Step 2: Download Decrypted Audiobook"] = splitFileByChapters ? Step2_DownloadAudiobookAsMultipleFilesPerChapter : Step2_DownloadAudiobookAsSingleFile, - ["Step 3: Create Cue"] = Step3_CreateCue, + ["Step 2: Download Decrypted Audiobook"] = splitFileByChapters + ? Step2_DownloadAudiobookAsMultipleFilesPerChapter + : Step2_DownloadAudiobookAsSingleFile, + ["Step 3: Create Cue"] = splitFileByChapters + ? () => true + : Step3_CreateCue, ["Step 4: Cleanup"] = Step4_Cleanup, }; } @@ -64,7 +68,7 @@ namespace AaxDecrypter OnDecryptProgressUpdate(zeroProgress); - + aaxFile.SetDecryptionKey(downloadLicense.AudibleKey, downloadLicense.AudibleIV); @@ -118,6 +122,7 @@ namespace AaxDecrypter var chapterCount = 0; aaxFile.ConvertToMultiMp4a(downloadLicense.ChapterInfo, newSplitCallback => { + // TODO I need to find a way to inject the track number into the m4b file. It's easier with the MP3. chapterCount++; var fileName = Path.ChangeExtension(outputFileName, $"{chapterCount}.m4b"); if (File.Exists(fileName)) diff --git a/AaxDecrypter/AudiobookDownloadBase.cs b/AaxDecrypter/AudiobookDownloadBase.cs index 4dbdeaac..a5436aab 100644 --- a/AaxDecrypter/AudiobookDownloadBase.cs +++ b/AaxDecrypter/AudiobookDownloadBase.cs @@ -59,7 +59,7 @@ namespace AaxDecrypter public abstract void Cancel(); protected abstract int GetSpeedup(TimeSpan elapsed); - protected abstract bool Step2_DownloadAudiobookAsSingleFile(); //TODO do I need to change this?? + protected abstract bool Step2_DownloadAudiobookAsSingleFile(); protected abstract bool Step1_GetMetadata(); public virtual void SetCoverArt(byte[] coverArt) diff --git a/AppScaffolding/AppScaffolding.csproj b/AppScaffolding/AppScaffolding.csproj index 886373bb..170455ab 100644 --- a/AppScaffolding/AppScaffolding.csproj +++ b/AppScaffolding/AppScaffolding.csproj @@ -7,10 +7,10 @@ - + diff --git a/FileLiberator/DownloadDecryptBook.cs b/FileLiberator/DownloadDecryptBook.cs index aebebba4..7aeb3088 100644 --- a/FileLiberator/DownloadDecryptBook.cs +++ b/FileLiberator/DownloadDecryptBook.cs @@ -155,8 +155,8 @@ namespace FileLiberator foreach (var f in sortedFiles) { var dest - = AudibleFileStorage.Audio.IsFileTypeMatch(f) - ? audioFileName + = f.Extension.Equals($".{musicFileExt}", StringComparison.OrdinalIgnoreCase) + ? Path.Join(destinationDir, f.Name) // non-audio filename: safetitle_limit50char + " [" + productId + "][" + audio_ext + "]." + non_audio_ext : FileUtility.GetValidFilename(destinationDir, product.Title, f.Extension, product.AudibleProductId, musicFileExt);