feat(metadata): initial implementation of OpenLibrary source (#1764)
This commit is contained in:
@@ -5,7 +5,7 @@ const EBOOK_EMBEDDABLE: ReadonlySet<string> = new Set([
|
||||
'title', 'subtitle', 'authors', 'publisher', 'publishedDate', 'language',
|
||||
'categories', 'description', 'seriesName', 'seriesNumber', 'seriesTotal',
|
||||
'isbn10', 'isbn13', 'moods', 'tags', 'ageRating', 'contentRating', 'pageCount',
|
||||
'asin', 'amazonRating', 'amazonReviewCount', 'googleId',
|
||||
'openlibraryId', 'asin', 'amazonRating', 'amazonReviewCount', 'googleId',
|
||||
'applebooksId', 'applebooksRating', 'applebooksReviewCount',
|
||||
'goodreadsId', 'goodreadsRating', 'goodreadsReviewCount',
|
||||
'hardcoverId', 'hardcoverBookId', 'hardcoverRating', 'hardcoverReviewCount',
|
||||
|
||||
@@ -41,6 +41,7 @@ describe('metadata-field.config', () => {
|
||||
|
||||
it('filters provider-backed fields when provider flags are supplied', () => {
|
||||
const enabledFields = {
|
||||
openlibraryId: false,
|
||||
googleId: true,
|
||||
asin: false,
|
||||
amazonRating: false,
|
||||
|
||||
@@ -28,6 +28,7 @@ export const ALL_METADATA_FIELDS: MetadataFieldConfig[] = [
|
||||
{ label: 'ISBN-10', controlName: 'isbn10', lockedKey: 'isbn10Locked', fetchedKey: 'isbn10', type: 'string' },
|
||||
{ label: 'ISBN-13', controlName: 'isbn13', lockedKey: 'isbn13Locked', fetchedKey: 'isbn13', type: 'string' },
|
||||
{ label: 'Pages', controlName: 'pageCount', lockedKey: 'pageCountLocked', fetchedKey: 'pageCount', type: 'number' },
|
||||
{ label: 'OpenLibrary ID', controlName: 'openlibraryId', lockedKey: 'openlibraryIdLocked', fetchedKey: 'openlibraryId', type: 'string', providerKey: 'openlibraryId' },
|
||||
{ label: 'Google ID', controlName: 'googleId', lockedKey: 'googleIdLocked', fetchedKey: 'googleId', type: 'string', providerKey: 'googleId' },
|
||||
{ label: 'ASIN', controlName: 'asin', lockedKey: 'asinLocked', fetchedKey: 'asin', type: 'string', providerKey: 'asin' },
|
||||
{ label: 'Amazon #', controlName: 'amazonReviewCount', lockedKey: 'amazonReviewCountLocked', fetchedKey: 'amazonReviewCount', type: 'number', providerKey: 'amazonReviewCount' },
|
||||
|
||||
@@ -51,6 +51,7 @@ export interface OidcAutoProvisionDetails {
|
||||
}
|
||||
|
||||
export interface MetadataProviderSettings {
|
||||
openLibrary: OpenLibrary;
|
||||
amazon: Amazon;
|
||||
google: Google;
|
||||
goodReads: Goodreads;
|
||||
@@ -63,6 +64,10 @@ export interface MetadataProviderSettings {
|
||||
appleBooks: AppleBooks;
|
||||
}
|
||||
|
||||
export interface OpenLibrary {
|
||||
enabled: boolean;
|
||||
}
|
||||
|
||||
export interface Amazon {
|
||||
enabled: boolean;
|
||||
cookie: string;
|
||||
@@ -209,6 +214,7 @@ export interface AppSettings {
|
||||
}
|
||||
|
||||
export interface MetadataProviderSpecificFields {
|
||||
openlibraryId: boolean;
|
||||
asin: boolean;
|
||||
amazonRating: boolean;
|
||||
amazonReviewCount: boolean;
|
||||
|
||||
Reference in New Issue
Block a user