Substantial refactoring of code structure
This commit is contained in:
@@ -1,34 +1,12 @@
|
||||
'use strict';
|
||||
|
||||
import Manifest from '../src/Manifest.js';
|
||||
import Common from '../src/common.js';
|
||||
//import Common from '../src/common.js';
|
||||
import { buildManifest } from '../src/service/ManifestBuilder.js';
|
||||
|
||||
/**
|
||||
* Generate a manifest object to serve
|
||||
* @param {string} manifestId
|
||||
*/
|
||||
export default async function generateManifest(manifestId) {
|
||||
const IIIF_API_VERSION = process.env.IIIF_API_VERSION;
|
||||
const BASE_URL = process.env.BASE_URL;
|
||||
|
||||
let manifest = new Manifest(IIIF_API_VERSION, BASE_URL);
|
||||
manifest.generateID(manifestId);
|
||||
manifest.generateLabel();
|
||||
|
||||
const images = await Common.getImageList(manifestId);
|
||||
|
||||
manifest = await Common.populateCanvases(
|
||||
manifest,
|
||||
images,
|
||||
manifestId
|
||||
);
|
||||
|
||||
manifest.setMetadata(
|
||||
Common.createMetadata(
|
||||
manifest,
|
||||
images[0],
|
||||
)
|
||||
);
|
||||
|
||||
return manifest.toObject();
|
||||
return buildManifest(manifestId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user