fix(series): group books by media from content files only

Count only primary and content files when profiling a book's media, so a
side image, cover or .nfo in an audiobook folder no longer adds it to the
Books group on the series page.

Fixes #1862
This commit is contained in:
neon
2026-10-20 03:54:29 +00:00
parent 5878c96254
commit 1214152bd5
3 changed files with 34 additions and 8 deletions
+2 -1
View File
@@ -166,7 +166,8 @@ export function getBookMediaKind(format: string | null | undefined): BookMediaKi
}
export function getBookMediaProfile(files: readonly BookMediaFile[]): BookMediaProfile {
const mediaKinds = files.map((file) => getBookMediaKind(file.format));
// Covers and sidecars such as a folder image or an .nfo fall through getBookMediaKind as "ebook".
const mediaKinds = files.filter((file) => file.role === "content" || file.role === "primary").map((file) => getBookMediaKind(file.format));
return {
primaryMediaKind: getBookMediaKind(getPrimaryBookFile(files)?.format),
hasEbook: mediaKinds.includes("ebook"),