feat(scanner): match library files by series name and position#390
Merged
feat(scanner): match library files by series name and position#390
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
bfed9e1 to
c803381
Compare
Closes: user feature request (LazyLibrarian migration, ABS layout) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
c803381 to
1809bca
Compare
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
SeriesandSeriesNumberfields toParsedFileParseFilenamenow extracts series info from bracket notation ([Series Name #N],[Series Name, Book 1]) and paren notation ((Series Name #N),(Series Name, Book 1)) — series name must start with a letter to avoid false-positives on ISBNs and yearsAuthor/Series Name, Book 1/title.m4b)ScanLibraryfalls back to series+position matching when ASIN and title+author both fail — exact series-title match + position, returns no match when ambiguous (two series with the same name both have a book at that position)WithSeriesRepobuilder toScannerGetBookBySeriesPositionrepo method inSeriesRepoFixes library scan failures for users migrating from LazyLibrarian
Users whose existing libraries have series-based filenames like:
These previously returned unmatched on library scan. With this PR they reconcile correctly against wanted books via series name + position.
Notes
Author/Series Name/01 - Title.m4b(no number in folder name) still relies on tag reading or title match — the parser can't infer series number from a plain folder name without a positionAuthor/Series Name, Book 1/Title.m4b(number in folder name via paren) is fully supportedTest plan
go test ./internal/importer/... ./internal/db/...