+
);
@@ -121,9 +121,7 @@ export default function PublicationPage(props: PublicationPageProps) {
{getSameLanguagePublications(pub).map((p) => {
- return (
-
- );
+ return ;
})}
diff --git a/components/publication-cover.tsx b/components/publication-cover.tsx
index 4e57f28..486e5aa 100644
--- a/components/publication-cover.tsx
+++ b/components/publication-cover.tsx
@@ -19,8 +19,8 @@ export function PublicationCover(props: PublicationProps): ReactNode {
alt={`${t("alt_text")} ${props.publication.title}`}
fill={true}
src={
- props.publication.image
- ? `/covers/${props.publication.signatur}.jpg`
+ props.publication.images
+ ? `/covers/${props.publication.id}.jpg`
: "/assets/images/logo.svg"
}
style={{ objectFit: "contain" }}
@@ -31,7 +31,7 @@ export function PublicationCover(props: PublicationProps): ReactNode {
export function ClickablePublicationThumbnail(props: PublicationProps) {
return (
-
+
);
diff --git a/scripts/tsv-to-json.py b/scripts/tsv-to-json.py
index 040d45a..abc03bd 100755
--- a/scripts/tsv-to-json.py
+++ b/scripts/tsv-to-json.py
@@ -186,12 +186,15 @@ def workkey(pub, i):
logger.error(f"{pub['Signatur']} does not have a numeric year ('{pub['year']}')")
year = None
+ assets = [ { 'id': pub['Signatur']} ] if os.path.isfile(f'../public/covers/{pub["Signatur"]}.jpg') else None
+ if len(pub['more']):
+ assets += [ { 'id': name } for name in pub['more'].split(', ') ]
+
publications[pub['Signatur']] = {
- # 'id': None,
- 'signatur': pub['Signatur'],
+ 'id': pub['Signatur'],
'erstpublikation': pub['EP?'] == 'x', # means at least one translation is published first time?
'parents': eltern,
- 'children': [],
+ 'later': [],
'more': pub['more'].split(', ') if pub['more'] else None, # TODO
'title': pub['title'],
'year': year,
@@ -202,7 +205,7 @@ def workkey(pub, i):
'isbn': pub['ISBN'] or None,
'exemplar_suhrkamp_berlin': pub['Exemplar Suhrkamp Berlin (03/2023)'].lower() == 'x',
'exemplar_oeaw': pub['Exemplar ÖAW'].lower() == 'x',
- 'image': {} if os.path.isfile(f'../public/covers/{pub["Signatur"]}.jpg') else None
+ 'images': assets
}
# redundantly store children ids in parent
diff --git a/types/model.ts b/types/model.ts
index 220a25f..0e368c7 100755
--- a/types/model.ts
+++ b/types/model.ts
@@ -1,51 +1,58 @@
// these end up in public URLs as slugs, so come up with good names!
-// TODO singular or plural for the url?
export enum Category {
- prose = "prose",
- drama = "drama & libretti",
- poetry = "poetry",
- letterspeechinterview = "letters, speeches, interviews",
- adaptations = "adaptations",
novels = "novels",
novellas = "novellas & short prose",
autobiography = "autobiography",
fragments = "fragments",
+
+ drama = "drama & libretti",
+ poetry = "poetry",
+ letterspeechinterview = "letters, speeches, interviews",
+ adaptations = "adaptations",
}
+export type Prose =
+ | Category.autobiography
+ | Category.fragments
+ | Category.novellas
+ | Category.novels;
+
/** Publication contains one or more translated works. */
export interface Publication {
- // id: string; // FIXME signatur can work as string?
- signatur: string;
- erstpublikation: boolean; // TODO: what is this? -- ist das nicht eher eine eigenschaft der translation?
- parents?: Array | null; // TODO JSON import gives nulls instead of undefined...
- children?: Array; // FIXME temporary
- more?: Array; // TODO foreign keys in the OpenRefine sheet, but no data on the sub-entries?
+ id: string; // 'signatur' in openrefine
title: string;
- year: number;
language: string;
contains: Array;
- publisher: Publisher;
categories: Array;
- // "autobiography" | "drama" | "letterspeechinterview" | "novel" | "novella" | "prose"
+
+ // from openrefine: whether this publication contains at least one previously unpublished
+ // translation
+ erstpublikation: boolean;
+
+ // ids of publications which contain re-prints of some of the translations first published in this
+ // publication. this field is inferred from the 'eltern' column in openrefine.
+ later?: Array;
+ year: number;
isbn?: string;
+ publisher: Publisher;
exemplar_suhrkamp_berlin: boolean;
exemplar_oeaw: boolean;
- image?: Asset;
+ images?: Array;
}
export interface Translation {
id: string;
+ title: string; // translated title
work: BernhardWork;
translators: Array;
- title: string; // translated
- // erstpublikation: Publication; // really: id is enough!
+ // erstpublikation?: string;
}
export interface BernhardWork {
id: string;
- gnd: string;
title: string; // german/french original
- year: number;
+ gnd?: string;
+ year?: number; // we get the years from gnd-lookup, so no gnd => no year info
}
export interface Translator {
@@ -61,9 +68,6 @@ interface Publisher {
}
interface Asset {
- // TODO asset filename is uniquely identified by publication signatur anyway, so actually more important
- // to store copyright information etc?
- id: string;
- type: string;
- path: string;
+ id: string; // same as filename (without extension, which is .jpg)
+ metadata?: string;
}