diff --git a/Source/LibationAvalonia/Controls/Settings/Import.axaml b/Source/LibationAvalonia/Controls/Settings/Import.axaml index affb6cda..9fdaa2cd 100644 --- a/Source/LibationAvalonia/Controls/Settings/Import.axaml +++ b/Source/LibationAvalonia/Controls/Settings/Import.axaml @@ -1,4 +1,4 @@ - - + diff --git a/Source/LibationAvalonia/ViewModels/Settings/ImportSettingsVM.cs b/Source/LibationAvalonia/ViewModels/Settings/ImportSettingsVM.cs index 6f7811f6..cb19638a 100644 --- a/Source/LibationAvalonia/ViewModels/Settings/ImportSettingsVM.cs +++ b/Source/LibationAvalonia/ViewModels/Settings/ImportSettingsVM.cs @@ -28,6 +28,7 @@ public class ImportSettingsVM public string ShowImportedStatsText { get; } = Configuration.GetDescription(nameof(Configuration.ShowImportedStats)); public string ImportEpisodesText { get; } = Configuration.GetDescription(nameof(Configuration.ImportEpisodes)); public string ImportPlusTitlesText { get; } = Configuration.GetDescription(nameof(Configuration.ImportPlusTitles)); + public string ImportPlusTitlesTip => Configuration.ImportPlusTitlesToolTip; public string DownloadEpisodesText { get; } = Configuration.GetDescription(nameof(Configuration.DownloadEpisodes)); public string AutoDownloadEpisodesText { get; } = Configuration.GetDescription(nameof(Configuration.AutoDownloadEpisodes)); diff --git a/Source/LibationFileManager/Configuration.HelpText.cs b/Source/LibationFileManager/Configuration.HelpText.cs index b10d363f..28808002 100644 --- a/Source/LibationFileManager/Configuration.HelpText.cs +++ b/Source/LibationFileManager/Configuration.HelpText.cs @@ -140,9 +140,17 @@ public partial class Configuration For an audio file to be identified, Libation must have that library book in its database. If you're on a fresh installation of Libation, be sure to add and scan all of your Audible accounts before running this action. This may take a while, depending on the number of audio files in the folder and the speed of your storage device. + """ }, + {nameof(ImportPlusTitles), """ + When enabled, books from the Audible Plus catalog (titles you stream or borrow under your membership, not purchased) are imported into Libation. + + Downloading or liberating many Plus titles in a short time can cause Audible to temporarily deny content licenses ("license denied") for a day or two. That limit is enforced by Audible, not Libation — waiting and retrying usually fixes it. If problems persist after several days, report on Libation's GitHub with logs. """ } }.AsReadOnly(); + /// Tooltip for the Import Audible Plus books checkbox. Use from WinForms and Avalonia import settings so both stay aligned. + public static string ImportPlusTitlesToolTip => GetHelpText(nameof(ImportPlusTitles)); + public static string GetHelpText(string? settingName) => settingName != null && HelpText.TryGetValue(settingName, out var value) ? value : ""; } diff --git a/Source/LibationUiBase/ContentLicenseDeniedUserMessage.cs b/Source/LibationUiBase/ContentLicenseDeniedUserMessage.cs new file mode 100644 index 00000000..369e38c9 --- /dev/null +++ b/Source/LibationUiBase/ContentLicenseDeniedUserMessage.cs @@ -0,0 +1,37 @@ +namespace LibationUiBase; + +/// +/// User-facing copy when Audible denies a content license (download/decrypt). Covers temporary +/// service issues and Audible Plus throttling — often mistaken for a Libation bug. +/// Shared by WinForms and Avalonia via the process queue. +/// +public static class ContentLicenseDeniedUserMessage +{ + public const string DialogCaption = "Content license denied"; + + public const string GitHubIssuesSearchUrl = "https://github.com/rmcrackan/Libation/issues?q=is%3Aissue+state%3Aclosed"; + + /// Generic outage / GenericError-style denial: not specific to Plus titles. + public static string BuildDialogBodyForPossibleOutage(string bookTitleWithSubtitle) + => $""" + You were denied a content license for {bookTitleWithSubtitle} + + This error often reflects a temporary interruption of service on Audible's side. It usually resolves within about 1 to 2 days, and in the meantime you should still be able to access your books through Audible's website or app. + + Heavy use of the Audible Plus catalog in a short time can also produce "license denied" responses; community reports often involve on the order of dozens of titles — Audible does not publish a fixed limit. Waiting 24 to 48 hours before trying again is usually enough. + + If the problem continues after several days, open an issue on Libation's GitHub and include your logs. Similar reports (for reference): {GitHubIssuesSearchUrl} + """; + + /// License denied on an Audible Plus title — often rate limiting, not a Libation defect. + public static string BuildDialogBodyForPlusCatalog(string bookTitleWithSubtitle) + => $""" + You were denied a content license for {bookTitleWithSubtitle} + + This title is from the Audible Plus catalog. Audible sometimes temporarily denies content licenses after heavy Plus use in a short period; community reports often mention on the order of dozens of downloads — Audible does not publish a fixed limit. This is usually not a Libation bug. + + Try waiting 24 to 48 hours and liberate again. If it still fails after several days, open an issue on Libation's GitHub with logs. Examples of similar closed reports: {GitHubIssuesSearchUrl} + + If you should not have access to this title (for example it left Plus before you downloaded), confirm in the Audible app or website. + """; +} diff --git a/Source/LibationUiBase/ProcessQueue/ProcessBookViewModel.cs b/Source/LibationUiBase/ProcessQueue/ProcessBookViewModel.cs index 9aa35a15..d602babb 100644 --- a/Source/LibationUiBase/ProcessQueue/ProcessBookViewModel.cs +++ b/Source/LibationUiBase/ProcessQueue/ProcessBookViewModel.cs @@ -58,16 +58,17 @@ public class ProcessBookViewModel : ReactiveObject public bool IsDownloading => Status is ProcessBookStatus.Working; public bool Queued => Status is ProcessBookStatus.Queued; - public string StatusText => Result switch + public string StatusText => (Result, LibraryBook.IsAudiblePlus) switch { - ProcessBookResult.Success => "Finished", - ProcessBookResult.Cancelled => "Cancelled", - ProcessBookResult.ValidationFail => "Validation fail", - ProcessBookResult.FailedRetry => "Error, will retry later", - ProcessBookResult.FailedSkip => "Error, Skipping", - ProcessBookResult.FailedAbort => "Error, Abort", - ProcessBookResult.LicenseDenied => "License Denied", - ProcessBookResult.LicenseDeniedPossibleOutage => "Possible Service Interruption", + (ProcessBookResult.Success, _) => "Finished", + (ProcessBookResult.Cancelled, _) => "Cancelled", + (ProcessBookResult.ValidationFail, _) => "Validation fail", + (ProcessBookResult.FailedRetry, _) => "Error, will retry later", + (ProcessBookResult.FailedSkip, _) => "Error, Skipping", + (ProcessBookResult.FailedAbort, _) => "Error, Abort", + (ProcessBookResult.LicenseDenied, true) => "License denied (Plus; often temporary)", + (ProcessBookResult.LicenseDenied, false) => "License Denied", + (ProcessBookResult.LicenseDeniedPossibleOutage, _) => "Possible Service Interruption", _ => Status.ToString(), }; @@ -161,6 +162,11 @@ public class ProcessBookViewModel : ReactiveObject LogInfo($"{procName}: Content license was denied, but this error appears to be caused by a temporary interruption of service. - {LibraryBook.Book}"); result = ProcessBookResult.LicenseDeniedPossibleOutage; } + else if (LibraryBook.IsAudiblePlus) + { + LogInfo($"{procName}: Content license denied for this Audible Plus catalog title. Audible often throttles license requests after heavy Plus use; try again in 1 to 2 days. If you should not have access, check the Audible app. - {LibraryBook.Book}"); + result = ProcessBookResult.LicenseDenied; + } else { LogInfo($"{procName}: Content license denied. Check your Audible account to see if you have access to this title. - {LibraryBook.Book}"); diff --git a/Source/LibationUiBase/ProcessQueue/ProcessQueueViewModel.cs b/Source/LibationUiBase/ProcessQueue/ProcessQueueViewModel.cs index 202476f5..958d9c81 100644 --- a/Source/LibationUiBase/ProcessQueue/ProcessQueueViewModel.cs +++ b/Source/LibationUiBase/ProcessQueue/ProcessQueueViewModel.cs @@ -2,6 +2,7 @@ using DataLayer; using LibationFileManager; using LibationUiBase.Forms; +using LibationUiBase; using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -274,7 +275,7 @@ public class ProcessQueueViewModel : ReactiveObject RunningTime = string.Empty; ProgressBarVisible = true; var startingTime = DateTime.Now; - bool shownServiceOutageMessage = false; + bool shownLicenseGuidanceMessage = false; using var counterTimer = new System.Threading.Timer(_ => RunningTime = timeToStr(DateTime.Now - startingTime), null, 0, 500); @@ -299,17 +300,19 @@ public class ProcessQueueViewModel : ReactiveObject Queue.ClearQueue(); else if (result == ProcessBookResult.FailedSkip) await nextBook.LibraryBook.UpdateBookStatusAsync(LiberatedStatus.Error); - else if (result == ProcessBookResult.LicenseDeniedPossibleOutage && !shownServiceOutageMessage) + else if (!shownLicenseGuidanceMessage + && (result == ProcessBookResult.LicenseDeniedPossibleOutage + || (result == ProcessBookResult.LicenseDenied && nextBook.LibraryBook.IsAudiblePlus))) { - await MessageBoxBase.Show($""" - You were denied a content license for {nextBook.LibraryBook.Book.TitleWithSubtitle} - - This error appears to be caused by a temporary interruption of service that sometimes affects Libation's users. This type of error usually resolves itself in 1 to 2 days, and in the meantime you should still be able to access your books through Audible's website or app. - """, - "Possible Interruption of Service", - MessageBoxButtons.OK, - MessageBoxIcon.Asterisk); - shownServiceOutageMessage = true; + var body = result == ProcessBookResult.LicenseDeniedPossibleOutage + ? ContentLicenseDeniedUserMessage.BuildDialogBodyForPossibleOutage(nextBook.LibraryBook.Book.TitleWithSubtitle) + : ContentLicenseDeniedUserMessage.BuildDialogBodyForPlusCatalog(nextBook.LibraryBook.Book.TitleWithSubtitle); + await MessageBoxBase.Show( + body, + ContentLicenseDeniedUserMessage.DialogCaption, + MessageBoxButtons.OK, + MessageBoxIcon.Asterisk); + shownLicenseGuidanceMessage = true; } ProcessEnd?.Invoke(this, nextBook); } diff --git a/Source/LibationWinForms/Dialogs/SettingsDialog.ImportLibrary.cs b/Source/LibationWinForms/Dialogs/SettingsDialog.ImportLibrary.cs index 8cacc128..5da27906 100644 --- a/Source/LibationWinForms/Dialogs/SettingsDialog.ImportLibrary.cs +++ b/Source/LibationWinForms/Dialogs/SettingsDialog.ImportLibrary.cs @@ -11,6 +11,7 @@ public partial class SettingsDialog this.useWebViewCb.Text = desc(nameof(config.UseWebView)); this.importEpisodesCb.Text = desc(nameof(config.ImportEpisodes)); this.importPlusTitlesCb.Text = desc(nameof(config.ImportPlusTitles)); + toolTip.SetToolTip(importPlusTitlesCb, Configuration.ImportPlusTitlesToolTip); this.downloadEpisodesCb.Text = desc(nameof(config.DownloadEpisodes)); this.autoDownloadEpisodesCb.Text = desc(nameof(config.AutoDownloadEpisodes));