Generate manifest label
This commit is contained in:
parent
3250b4a0f6
commit
e9e299d845
@ -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,
|
||||
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user