feat(metadata): store and write hardcover edition IDs

Adds hardcoverEditionId to the database schema and shared types, enabling it to be stored as first-class metadata. Updates the file metadata parsers and writers (EPUB, PDF, CBZ) to read and embed this ID, and exposes it in the frontend metadata editor.

Closes #420
This commit is contained in:
neon
2026-06-25 18:55:22 +00:00
parent d1442b6d44
commit 2af4895e69
70 changed files with 11679 additions and 7 deletions
+4
View File
@@ -70,6 +70,8 @@ export type BookCard = {
publisher: string | null;
pageCount: number | null;
isbn13: string | null;
hardcoverId?: string | null;
hardcoverEditionId?: string | null;
narrators: string[];
tags: string[];
collapsedSeries?: import("./series-collapse").CollapsedSeriesInfo;
@@ -132,6 +134,7 @@ export type BookDetail = {
seriesMemberships?: BookSeriesMembership[];
rating: number | null;
coverSource: "extracted" | "custom" | null;
hardcoverEditionId: string | null;
providerIds: ProviderIds;
authors: { id: number; name: string; sortName: string | null }[];
genres: string[];
@@ -173,6 +176,7 @@ export type BookMetadataRefreshPreviewFields = {
goodreadsId?: string | null;
amazonId?: string | null;
hardcoverId?: string | null;
hardcoverEditionId?: string | null;
openLibraryId?: string | null;
itunesId?: string | null;
audibleId?: string | null;
+2
View File
@@ -21,6 +21,7 @@ export const COMMON_PROVIDER_BOOK_FILE_WRITE_FIELDS = [
"goodreadsId",
"amazonId",
"hardcoverId",
"hardcoverEditionId",
"openLibraryId",
"ranobedbId",
"koboId",
@@ -74,6 +75,7 @@ export const BOOK_FILE_WRITE_FIELD_LABELS = {
goodreadsId: "Goodreads ID",
amazonId: "Amazon ID",
hardcoverId: "Hardcover ID",
hardcoverEditionId: "Hardcover edition ID",
openLibraryId: "Open Library ID",
ranobedbId: "RanobeDB ID",
koboId: "Kobo ID",
+2
View File
@@ -40,6 +40,7 @@ export interface MetadataSeriesMembership {
export interface MetadataCandidate {
provider: MetadataProviderKey;
providerId: string;
hardcoverEditionId?: string;
title: string;
subtitle?: string;
authors?: string[];
@@ -114,4 +115,5 @@ export interface MetadataSource {
narrators: string[];
durationSeconds: number | null;
abridged: boolean | null;
hardcoverEditionId: string | null;
}
+2
View File
@@ -21,6 +21,7 @@ export const BOOK_METADATA_LOCK_FIELDS = [
"goodreadsId",
"amazonId",
"hardcoverId",
"hardcoverEditionId",
"openLibraryId",
"itunesId",
"audibleId",
@@ -82,6 +83,7 @@ export const BOOK_METADATA_LOCK_GROUPS: BookMetadataLockGroup[] = [
"goodreadsId",
"amazonId",
"hardcoverId",
"hardcoverEditionId",
"openLibraryId",
"itunesId",
"audibleId",