mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 00:11:37 -06:00
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:
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user