feat(metadata): initial implementation of Apple Books source (#1780)

This commit is contained in:
James Ward
2026-09-12 14:10:20 -04:00
committed by GitHub
parent 828806a4aa
commit 0660e1d6dc
70 changed files with 1132 additions and 51 deletions
@@ -6,6 +6,7 @@ const EBOOK_EMBEDDABLE: ReadonlySet<string> = new Set([
'categories', 'description', 'seriesName', 'seriesNumber', 'seriesTotal',
'isbn10', 'isbn13', 'moods', 'tags', 'ageRating', 'contentRating', 'pageCount',
'asin', 'amazonRating', 'amazonReviewCount', 'googleId',
'applebooksId', 'applebooksRating', 'applebooksReviewCount',
'goodreadsId', 'goodreadsRating', 'goodreadsReviewCount',
'hardcoverId', 'hardcoverBookId', 'hardcoverRating', 'hardcoverReviewCount',
'lubimyczytacId', 'lubimyczytacRating',
@@ -59,7 +59,10 @@ describe('metadata-field.config', () => {
ranobedbRating: false,
audibleId: false,
audibleRating: false,
audibleReviewCount: false
audibleReviewCount: false,
applebooksId: false,
applebooksRating: false,
applebooksReviewCount: false,
};
expect(getProviderFields(enabledFields).map((field) => field.controlName)).toEqual(['googleId']);
@@ -46,7 +46,10 @@ export const ALL_METADATA_FIELDS: MetadataFieldConfig[] = [
{ label: 'Ranobedb ★', controlName: 'ranobedbRating', lockedKey: 'ranobedbRatingLocked', fetchedKey: 'ranobedbRating', type: 'number', providerKey: 'ranobedbRating' },
{ label: 'Audible ID', controlName: 'audibleId', lockedKey: 'audibleIdLocked', fetchedKey: 'audibleId', type: 'string', providerKey: 'audibleId' },
{ label: 'Audible ★', controlName: 'audibleRating', lockedKey: 'audibleRatingLocked', fetchedKey: 'audibleRating', type: 'number', providerKey: 'audibleRating' },
{ label: 'Audible #', controlName: 'audibleReviewCount', lockedKey: 'audibleReviewCountLocked', fetchedKey: 'audibleReviewCount', type: 'number', providerKey: 'audibleReviewCount' }
{ label: 'Audible #', controlName: 'audibleReviewCount', lockedKey: 'audibleReviewCountLocked', fetchedKey: 'audibleReviewCount', type: 'number', providerKey: 'audibleReviewCount' },
{ label: 'Apple Books ID', controlName: 'applebooksId', lockedKey: 'applebooksIdLocked', fetchedKey: 'applebooksId', type: 'string', providerKey: 'applebooksId' },
{ label: 'Apple Books ★', controlName: 'applebooksRating', lockedKey: 'applebooksRatingLocked', fetchedKey: 'applebooksRating', type: 'number', providerKey: 'applebooksRating' },
{ label: 'Apple Books #', controlName: 'applebooksReviewCount', lockedKey: 'applebooksReviewCountLocked', fetchedKey: 'applebooksReviewCount', type: 'number', providerKey: 'applebooksReviewCount' },
];
// Audiobook content metadata fields (narrator/abridged) - now stored at top level of BookMetadata
@@ -60,6 +60,7 @@ export interface MetadataProviderSettings {
douban: Douban;
lubimyczytac: Lubimyczytac;
audible: Audible;
appleBooks: AppleBooks;
}
export interface Amazon {
@@ -106,6 +107,11 @@ export interface Audible {
domain: string;
}
export interface AppleBooks {
enabled: boolean;
country: string;
}
export interface FormatWriteSettings {
enabled: boolean;
maxFileSizeInMb: number;
@@ -222,6 +228,9 @@ export interface MetadataProviderSpecificFields {
audibleId: boolean;
audibleRating: boolean;
audibleReviewCount: boolean;
applebooksId: boolean;
applebooksRating: boolean;
applebooksReviewCount: boolean;
}
export enum AppSettingKey {