Skip to content

fix(collection): apply the language preference to library books, not just suggestions - #954

Open
m4bard wants to merge 2 commits into
Listenarrs:canaryfrom
m4bard:fix/86-author-page-language-filter
Open

m4bard wants to merge 2 commits into
Listenarrs:canaryfrom
m4bard:fix/86-author-page-language-filter

Conversation

@m4bard

@m4bard m4bard commented Sep 10, 2026

Copy link
Copy Markdown

Fixes #955.

An author page states a language in its header, from the same preference that filters the catalog suggestions below it, and then lists library rows in every language. The filter (shouldIncludeRemoteCatalogBook) was only ever applied to remote catalog books; library rows reach the list by two other paths and neither checked anything.

This applies the preference to library rows on both paths. On the matched path (a catalog book paired with a library row by findLibraryMatch) the row is marked consumed before the decision, so a row dropped there cannot come back underneath as a Not Added suggestion. On the unmatched path the same predicate runs over the remaining library rows.

Three deliberate differences from the catalog rule, each there to avoid hiding something the user has:

  • A monitored book is always shown. Monitoring is an explicit statement that the user wants the record; a language preference should not overrule it.
  • A book with no language is shown. Dropping an unknown is right when deciding what to suggest and wrong when deciding what to hide.
  • Setting the preference to All disables the filter, as it already did for suggestions.

An earlier version filtered only the unmatched path, and on a real install every foreign edition came in through the matched path, because Audible lists an author's translations in the author catalog and each one matched its own library row by ASIN. That is why there are two reproduction tests, one per path, and why the change was validated on the install before being sent: an author page that listed unmonitored translated editions next to the originals no longer lists them. That is the one thing observed there; the three exceptions above are pinned by tests, not by the install.

Tests: five in CollectionView.spec.ts. Two reproductions (matched path, unmatched path) fail without the change; three guards pin the exceptions (monitored kept, unknown language kept, All disables). vue-tsc and eslint clean.

Not in this PR: exposing MonitoredAuthor.Language in the UI, and the series page, which has the same two paths and is covered by the discussion in #953.

Disclosure: drafted with Claude Code at my direction; I read the cited code at the stated commit and reviewed this before posting.

…just suggestions

An author page states a language in its header, from the same preference that
filters the catalog suggestions below it, and then lists library records in every
language regardless. Reported from an install where a page announcing English
listed the German editions of a series alongside the English ones the user owns.

The filter was only ever applied to remote catalog books, through
shouldIncludeRemoteCatalogBook. Library records reach the same list by a separate
path and were never filtered by anything. The page's own header therefore
promised a language context the list did not honour.

An earlier version of this change filtered only the unmatched library records,
which left the other way in untouched. A catalog listing for an author includes
that author's foreign-language editions, so a book held in another language
matches its own catalog entry by ASIN and came back from the matched branch with
no language check on it. The page went on showing every language, which is how
this turned up on a running install rather than in the tests. The matched branch
now applies the same rule, and marks the library row consumed before it decides,
so a book dropped there cannot reappear underneath as a Not Added suggestion.

Two deliberate differences from the catalog rule, both there to avoid hiding
something the user has.

A monitored book is always kept. Monitoring is an explicit statement that the
user wants this record and a language preference should not overrule it.

A book whose language is unknown is kept, which is the opposite of the catalog
rule. Dropping an unknown is right when deciding what to suggest and wrong when
deciding what to hide: a missing language field is not evidence that a book the
user owns is unwanted.

Setting the preference to All disables it, as it already did for suggestions.

Five tests. Two are reproductions, one for each path a library record takes, and
both fail without the change. The other three are guards that pass either way on
purpose, pinning that a monitored book, a book with no language, and an All
preference are all left alone. They are the cases where getting this wrong would
hide something.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit 265a790fb4b8e94156c73e5c4707654bbb442790)
prettier --check fails on CollectionView.spec.ts at the branch tip: the book
fixtures in the tests added here run past the repository's 100 column setting.
Only whitespace changes; the tests are unaltered and still pass.

The repository's CI lint job runs eslint and the vue-handlers check but not
prettier, so this does not show up as a red check.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@m4bard
m4bard force-pushed the fix/86-author-page-language-filter branch from 9d9bc4d to 750f83a Compare September 15, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

An author page announces a language and then lists library books in every language; the preference only ever filtered the catalog suggestions

1 participant