Repository navigation
feat: first-class account re-registration lifecycle with automatic throttling recovery (#2126) - #2145
Merged
Mbucari merged 8 commits intoNov 12, 2026
Conversation
…policy - Add Account.RequiresReRegistration property and HasObsoleteDeviceRegistration predicate - Update AccountCredentialStatus to treat RequiresReRegistration as missing credentials - Introduce ThrottledDeviceRecovery service to detect throttling on obsolete profiles and mark accounts for re-registration - Add unit tests for Account, AccountCredentialStatus, and ThrottledDeviceRecovery
…ad queue - Intercept RequiresReRegistration in ApiExtended, invalidate tokens during login, and reset flag upon success - Add LicenseDeniedThrottledRecovered queue status and user message - Update ProcessBookViewModel, ProcessQueueViewModel, and _ProcessableOptionsBase to handle throttled recovery during liberation
- Prompt to mark accounts for re-registration when Widevine is enabled in Avalonia and WinForms - Guard settings toggle against passive navigation/loading events and revert cleanly on cancel - Show 're-login needed' in 'list-accounts' and automatically re-register in 'login-external' - Add CLI tests for re-registration detection and flow in LoginExternalOptionsTests
…ance - Clarify distinction between device-registration throttling and volume rate limits - Document automatic settings migration and re-registration flow across GUI and CLI - Advise using Daily Download Limit when bulk re-downloading after scanning for higher quality audio - Remove obsolete manual account deletion and JSON editing instructions
… upgrading book quality When upgrading audio quality via 'Scan Audible for Higher Quality Audio', marking books for re-download previously left Widevine disabled and accounts under legacy registrations, causing subsequent downloads to re-acquire the existing lower-quality AAC-LC stream. - Update FindBetterQualityBooksViewModel.MarkBooksAsync() to return a MarkBooksResult and automatically enable Widevine and Request xHE-AAC when higher-quality streams are selected. - Thunk accounts to CurrentAndroid and mark them for re-registration via ThrottledDeviceRecovery so that Widevine-protected and higher-quality codecs can be licensed without manual troubleshooting. - Alert user in Avalonia and WinForms dialogs when settings and registrations have been automatically upgraded. - Fix broken sentence and note daily download limits and rate limiting in FindBetterQualityBooksViewModel.InitialMessage. - Add unit tests in FindBetterQualityBooksViewModelTests covering clean and upgraded re-registration paths.
…istration on save
Contributor
Author
|
The newer commit adds a checkbox to each account on the Accounts page to allow the user to see, and optionally to clear, the registration on the account; documentation updated as well. This was done because I noticed I'd missed an error message that suggests logging out was a good idea, so I needed to give a way to do that in GUI (the CLI already could). |
…ADRM fails (rmcrackan#2083) - Detects missing ADRM asset (Sable 000307 acr:null) and missing AAX fallback codecs in titles that only deliver via Widevine. - Instead of merely advising the user to change settings manually, automatically applies recovery via ThrottledDeviceRecovery.ApplyRecovery (sets UseWidevine = true, CurrentAndroid, and marks the account for re-registration). - Modernizes user-facing dialogs, process queue status, and CLI feedback to explain that Widevine DRM was enabled and a fresh login is required.
Contributor
Author
|
Added automatic recovery for titles requiring Widevine DRM (#2083):
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: first-class account re-registration lifecycle with automatic throttling recovery (#2126)
Summary
This PR introduces a first-class account re-registration lifecycle (
Account.RequiresReRegistration) that allows Libation to prompt for and negotiate a fresh device registration without destroying user libraries, account metadata, or database associations.By establishing this non-destructive re-registration mechanism:
CustomerThrottlederrors due to obsolete or legacy registrations are automatically thunked toCurrentAndroid+ Widevine and prompted for a seamless re-login, resolving the longstanding throttling issues reported across the project.Closes #2021, #2041, #2070, #2093, #2110, #2121, #2140, #2139, #2133, #2128, #2096, #2077, #2083
Fixes #2126
The Central Problem: No Way to "Thunk" an Account's Registration
Previously, Libation had no intermediate state between "fully authenticated" and "account deleted". When an account's device registration became obsolete or incompatible with requested streams, the only remedy was scorched-earth:
Settings > Accounts(or manually editAccountsSettings.json).This architectural limitation caused two major user pain points:
Audible
CustomerThrottledDenials:Audible increasingly denies content license requests (
CustomerThrottled) to accounts registered under legacy device profiles (Windows, non-hex serials, 16-character serials) or downloading non-Widevine streams. Because Libation could not flag an existing account for re-registration, downloads in the queue would simply fail or direct users to static troubleshooting docs.The Higher-Quality Audio Upgrade Loop ("better quality" scan & download doesn't stick (was ""better quality" -- maybe just discussion and user education") #2126):
Obtaining Widevine and xHE-AAC streams strictly requires an Android-based device registration. When users used the "Scan Audible for Higher Quality Audio" tool to find better-quality audio, Libation would mark books as "Download Pending" but couldn't safely thunk the user's accounts to an Android Widevine registration. Users were left with unchanged global settings, causing subsequent downloads to repeatedly fetch the existing low-quality AAC-LC stream over and over.
Architecture & Key Changes
1. The Re-Registration Lifecycle (
Account.RequiresReRegistration)Account.RequiresReRegistration, persisted inAccountsSettings.json.Account.HasObsoleteDeviceRegistration()to identify legacy device types and non-conformant serials (validating against modern 20-character ASCII hex Android device serials).RequiresReRegistrationis cleared automatically.2. Automatic Throttling Policy (
ThrottledDeviceRecovery)ContentLicenseDeniedException(CustomerThrottled):ShouldRecover: Identifies whether a throttle is registration-related (legacy profile or missing Widevine).ApplyRecovery: Automatically switches settings toUseWidevine = trueandDeviceRegistrationKind.CurrentAndroid, and marks accounts for re-registration via the new flag.CustomerThrottled,ProcessBookViewModeland_ProcessableOptionsBaseinvokeApplyRecoveryand transition the item toLicenseDeniedThrottledRecovered, cleanly pausing the queue with guidance rather than looping or failing permanently.3. Seamless Quality Upgrades as a Natural Result (#2126)
With the re-registration capability in place, resolving #2126 became straightforward:
FindBetterQualityBooksViewModel.MarkBooksAsync()queues books for higher-quality downloads:UseWidevine = true, setsRequest_xHE_AAC = true(if xHE-AAC was found), and usesThrottledDeviceRecoveryto mark accounts for the required Android registration.MarkBooksResult.GetSummaryMessage()unifies user messaging across Avalonia and WinForms, letting the user know settings were upgraded and whether a re-login prompt will appear on the next run.InitialMessage), fixing a truncated sentence and noting rate-limiting options (Daily Download Limit) when queuing large libraries for quality upgrades.4. GUI & CLI Integration
ThrottledDeviceRecovery, eliminating duplicated prompt text across frontends.list-accounts&login-external):list-accountsindicatesre-login neededunder thevalidcolumn whenRequiresReRegistrationis set.login-externaldetects when an account needs re-registration or has an obsolete profile, automatically proceeds with authentication, updates the device profile to Android, and clears the flag upon completion.5. Documentation
docs/advanced/device-registration.md,docs/features/audio-file-formats.md,docs/features/daily-download-limit.md, and troubleshooting guides to describe the automated recovery flow and distinguish registration-based throttling from daily download rate limits.Verification & Testing
AudibleUtilities.Tests: Unit tests forRequiresReRegistration,HasObsoleteDeviceRegistration(testing modern 20-hex vs 16/32/non-hex formats),ApplyRecovery, andMarkObsoleteAccounts.LibationUiBase.Tests: AddedFindBetterQualityBooksViewModelTestsverifying the automatic upgrade flow, config changes, and summary messaging.LibationCli.Tests: Tests for CLI re-registration detection inLoginExternalOptionsTests.AudibleUtilities.Tests, 252 passed inLibationUiBase.Tests, 96 passed inLibationCli.Tests.net10.0/ non-Windows SDK withEnableWindowsTargeting) with 0 warnings and 0 errors.