Link existing downloads after library sync#14
Merged
Conversation
Link existing downloads after library sync
Owner
|
Thank you, has been bugging me while testing |
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.
Summary
This change links existing Android audiobook files after library sync. When the Library sync finishes, LibriSync scans the configured Download Directory, matches existing audio files to synced audiobooks, and records the matching file path as a completed download.
It also tightens the sync entry point: users must choose a Download Directory before starting Library sync, and the Library view can now sort by downloaded state.
What changed
DownloadedLibrary sort mode.Downloadedsort group downloaded and not-downloaded books while preserving the previous sort inside each group.User impact
Users who already have audiobooks in the selected Download Directory can sync their Library and have those existing files linked automatically instead of downloading them again or manually link the downloaded file.
The Download Directory requirement makes the sync flow explicit before any existing-download scan runs. The new
Downloadedsort makes it easier to review what is already linked locally and what is still missing.Implementation notes
The Android scanner handles both SAF/content URI directories and file paths. It walks audio files recursively, builds matching candidates from audiobook metadata, and skips ambiguous matches.
The Rust storage query now joins completed download tasks into Library results. The
downloadedsort is implemented as a grouping sort: downloaded status determines the outer group order, while the prior Library sort is used inside each group.Validation
Automated and build validation run for this branch:
npm run typecheckcargo checkcargo test --lib test_list_books_with_filters_sorts_by_downloaded_statuscargo test --lib test_set_book_file_path_updates_existing_completed_task./gradlew :app:compileDebugKotlingit diff --checkLocal Android validation also performed:
npm run build:rust:androidnpx expo run:android./gradlew :app:assembleRelease