Skip to content

fix(library): sort audiobook files by natural filename order#746

Draft
kevinheneveld wants to merge 1 commit into
Listenarrs:canaryfrom
kevinheneveld:fix/audiobook-file-list-natural-sort
Draft

fix(library): sort audiobook files by natural filename order#746
kevinheneveld wants to merge 1 commit into
Listenarrs:canaryfrom
kevinheneveld:fix/audiobook-file-list-natural-sort

Conversation

@kevinheneveld

Copy link
Copy Markdown
Contributor

Summary

  • EF returns audiobook files in undefined (row-insertion/scan) order, so multi-part books rendered jumbled on the detail page ("Part 116, 100, 049, 065, 095, 016..." instead of ascending order)
  • Add a shared NaturalSort key builder (treats embedded digit runs as numeric so "Part 2" sorts before "Part 10") and an AudiobookFileOrdering.InNaturalOrder helper
  • Apply it to the two API projections that feed the frontend file list: the audiobook detail-page endpoint (LibraryQueryWorkflow.MapDetails) and the DTO builder used by scan/move broadcasts (AudiobookDtoFactory.BuildFromEntity)

Test plan

  • dotnet build — clean, 0 warnings
  • dotnet test — 1189/1189 passing

Draft per PR-pacing convention (several PRs already active); will promote when a slot frees up.

EF returns audiobook files in undefined (row-insertion/scan) order, so
multi-part books rendered jumbled on the detail page ("Part 116, 100,
049, 065, 095, 016..." instead of ascending order).

Add a shared NaturalSort key builder (treats embedded digit runs as
numeric so "Part 2" sorts before "Part 10") and an
AudiobookFileOrdering.InNaturalOrder helper, then apply it to the two
API projections that feed the frontend file list: the audiobook
detail-page endpoint and the DTO builder used by scan/move broadcasts.
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.

1 participant