Skip to content

Library sort resets to Title on every visit (not remembered) #787

Description

@dny238

Describe the bug

The Audiobooks library (/audiobooks?group=books) always resets its sort to Title (ascending) on every visit. If you change the sort — e.g. to Publisher, or Release Year descending — it's forgotten as soon as you navigate away and come back, so you have to re-select it each time.

Other view preferences on this page already persist to localStorage (grouping via listenarr.groupBy, search via listenarr.searchQuery, show-details, custom filters), but the sort key/order does not — sortState is initialized to DEFAULT_SORTS on every mount.

To Reproduce

  1. Go to Audiobooks, grouped by Books.
  2. Change the sort to something other than Title (e.g. Publisher, descending).
  3. Navigate away and back (or reload).
  4. The sort is back to Title ascending.

Expected behavior

The library should remember the last sort (key + direction, per grouping) and restore it on the next visit, the same way grouping and search are already remembered.

Additional context

AudiobooksView.vuesortState is a plain reactive initialized from DEFAULT_SORTS, with no load/save against localStorage. Fix is to hydrate it from storage on init and persist on change, mirroring the existing listenarr.groupBy / listenarr.searchQuery handling. PR incoming.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions