feat(magic-shelf): add ISBN-10 and ISBN-13 metadata fields to book rules (#2196)
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
This commit is contained in:
@@ -52,6 +52,8 @@ export type RuleField =
|
||||
| 'seriesTotal'
|
||||
| 'pageCount'
|
||||
| 'language'
|
||||
| 'isbn13'
|
||||
| 'isbn10'
|
||||
| 'amazonRating'
|
||||
| 'amazonReviewCount'
|
||||
| 'goodreadsRating'
|
||||
@@ -127,6 +129,8 @@ const FIELD_CONFIGS: Record<RuleField, FullFieldConfig> = {
|
||||
personalRating: {label: 'Personal Rating', type: 'decimal', max: 10},
|
||||
pageCount: {label: 'Page Count', type: 'number'},
|
||||
language: {label: 'Language'},
|
||||
isbn13: {label: 'ISBN-13'},
|
||||
isbn10: {label: 'ISBN-10'},
|
||||
seriesName: {label: 'Series Name'},
|
||||
seriesNumber: {label: 'Series Number', type: 'number'},
|
||||
seriesTotal: {label: 'Books in Series', type: 'number'},
|
||||
@@ -349,7 +353,7 @@ export class MagicShelfComponent implements OnInit {
|
||||
if (!field) return [...baseOperators, ...multiValueOperators];
|
||||
|
||||
const config = FIELD_CONFIGS[field];
|
||||
const isMultiValueField = ['library', 'authors', 'categories', 'moods', 'tags', 'readStatus', 'fileType', 'language', 'title', 'subtitle', 'publisher', 'seriesName'].includes(field);
|
||||
const isMultiValueField = ['library', 'authors', 'categories', 'moods', 'tags', 'readStatus', 'fileType', 'language', 'title', 'subtitle', 'publisher', 'seriesName', 'isbn13', 'isbn10'].includes(field);
|
||||
const operators = [...baseOperators];
|
||||
|
||||
if (isMultiValueField) {
|
||||
|
||||
@@ -61,6 +61,10 @@ export class BookRuleEvaluatorService {
|
||||
return [String(book.metadata?.publisher ?? '').toLowerCase()];
|
||||
case 'seriesName':
|
||||
return [String(book.metadata?.seriesName ?? '').toLowerCase()];
|
||||
case 'isbn13':
|
||||
return [String(book.metadata?.isbn13 ?? '').toLowerCase()];
|
||||
case 'isbn10':
|
||||
return [String(book.metadata?.isbn10 ?? '').toLowerCase()];
|
||||
default:
|
||||
return [];
|
||||
}
|
||||
@@ -232,6 +236,10 @@ export class BookRuleEvaluatorService {
|
||||
return book.metadata?.pageCount;
|
||||
case 'language':
|
||||
return book.metadata?.language?.toLowerCase() ?? null;
|
||||
case 'isbn13':
|
||||
return book.metadata?.isbn13?.toLowerCase() ?? null;
|
||||
case 'isbn10':
|
||||
return book.metadata?.isbn10?.toLowerCase() ?? null;
|
||||
case 'amazonRating':
|
||||
return book.metadata?.amazonRating;
|
||||
case 'amazonReviewCount':
|
||||
|
||||
Reference in New Issue
Block a user