Include physical books in the Book Type filter (#3205)
This commit is contained in:
+2
-1
@@ -203,7 +203,7 @@ export const FILTER_EXTRACTORS: Readonly<Record<Exclude<FilterType, 'library'>,
|
||||
author: (book) => extractStringsAsFilters(book.metadata?.authors),
|
||||
category: (book) => extractStringsAsFilters(book.metadata?.categories),
|
||||
series: (book) => extractSingleString(book.metadata?.seriesName?.trim()),
|
||||
bookType: (book) => extractSingleString(book.primaryFile?.bookType),
|
||||
bookType: (book) => book.isPhysical ? [{id: 'PHYSICAL', name: 'PHYSICAL'}] : extractSingleString(book.primaryFile?.bookType),
|
||||
readStatus: (book) => {
|
||||
const status = book.readStatus ?? ReadStatus.UNSET;
|
||||
const validStatus = status in READ_STATUS_LABELS ? status : ReadStatus.UNSET;
|
||||
@@ -325,6 +325,7 @@ export const SHELF_STATUS_LABEL_KEYS: Readonly<Record<string, string>> = {
|
||||
'unshelved': 'book.filter.shelfStatus.unshelved'
|
||||
};
|
||||
|
||||
|
||||
export const COMIC_ROLE_LABEL_KEYS: Readonly<Record<string, string>> = {
|
||||
penciller: 'book.filter.comicRoles.penciller',
|
||||
inker: 'book.filter.comicRoles.inker',
|
||||
|
||||
@@ -76,7 +76,7 @@ export function doesBookMatchFilter(
|
||||
? filterValues.some(val => book.metadata?.seriesName?.trim() === val)
|
||||
: filterValues.every(val => book.metadata?.seriesName?.trim() === val);
|
||||
case 'bookType':
|
||||
return filterValues.includes(book.primaryFile?.bookType);
|
||||
return book.isPhysical ? filterValues.includes('PHYSICAL') : filterValues.includes(book.primaryFile?.bookType);
|
||||
case 'readStatus':
|
||||
return doesBookMatchReadStatus(book, filterValues);
|
||||
case 'personalRating':
|
||||
|
||||
Reference in New Issue
Block a user