fix(scanner): keep audiobook tracks in file name order

The player follows each track's stored sort order, which overlapping
folder scans, Add File, and imports joining a book could leave out of
step with the file names the Files tab shows. Realign a book's tracks
after each of those writes, under the book row lock.

Closes #1681
This commit is contained in:
neon
2026-10-12 05:05:13 +00:00
parent 0c367b2b57
commit 688cfdeaec
15 changed files with 796 additions and 4 deletions
+23
View File
@@ -101,6 +101,29 @@ export const E2E_SUITES = Object.freeze({
...SHARED_DB_AND_HELPER_PATHS,
],
},
"audiobook-track-order": {
id: "audiobook-track-order",
name: "Audiobook Track Order",
timeout: 45,
lane: "full",
description: "Audiobook playback order matches file names after overlapping scans and added tracks",
vitestTarget: "test/audiobook-track-order.e2e-spec.ts",
junitOutput: `${TEST_RESULTS_DIR}/audiobook-track-order-e2e-junit.xml`,
prepareDedicatedDatabase: true,
useDedicatedDatabase: true,
changedPaths: [
"server/src/common/utils/audio-track-order.utils.ts",
"server/src/common/utils/book-media.utils.ts",
"server/src/db/audio-track-order.ts",
"server/src/modules/audiobook/**",
"server/src/modules/scanner/**",
"server/src/modules/upload/**",
"server/test/audiobook-track-order.e2e-spec.ts",
"server/test/e2e/scanner/**",
".github/workflows/e2e-runner.yml",
...SHARED_DB_AND_HELPER_PATHS,
],
},
"auth-session-security": {
id: "auth-session-security",
name: "Auth Session Security",