diff --git a/controllers/manifest.mjs b/controllers/manifest.mjs index 43b30c3..160e073 100644 --- a/controllers/manifest.mjs +++ b/controllers/manifest.mjs @@ -13,6 +13,7 @@ export default async function generateManifest(manifestId) { let manifest = new Manifest(IIIF_API_VERSION, BASE_URL); manifest.generateID(manifestId); + manifest.generateLabel(); manifest = await Common.populateCanvases( manifest, diff --git a/src/Manifest.js b/src/Manifest.js index 586e327..c80e482 100644 --- a/src/Manifest.js +++ b/src/Manifest.js @@ -5,7 +5,8 @@ import Sequence from "./Sequence.js"; */ class Manifest { id = ''; - type = 'sc:Manifest'; + _type = 'sc:Manifest'; + _label = ''; resourceId = ''; /** * @var {Sequence[]} @@ -29,6 +30,12 @@ class Manifest { this.id = `${this.BASE_URL}/${resourceId}/manifest` ; this.resourceId = resourceId; } + /** + * Create IIIF label for this manifest + */ + generateLabel() { + this._label = `P.Herc. ${this.resourceId.split('-')[1]}`; + } /** * Object representation of this * manifest @@ -40,7 +47,8 @@ class Manifest { return { "@context" : this.context, "@id" : this.id, - "@type" : this.type, + "@type" : this._type, + label : this._label, sequences: this.sequences, } }