Skip to content

Commit

Permalink
Merge pull request #117 from AVAnnotate/lwj/url-fix
Browse files Browse the repository at this point in the history
URL and ID fix
  • Loading branch information
lwjameson authored Dec 9, 2024
2 parents 277e088 + 0876821 commit 2e3f8ca
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions generate-iiif-3-manifests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const createManifest = (
);
const output: Manifest = {
'@context': 'http://iiif.io/api/presentation/3/context.json',
id: `${siteURL}/manifest.json`,
id: `${siteURL}/manifests/manifest.json`,
type: 'Manifest',
label: { en: [projectData.project.slug] },
homepage: [
Expand Down Expand Up @@ -193,8 +193,14 @@ export const createManifest = (
}
}

const source = avFile.file_url.split('?');
const type = mime.lookup(source[0]);
const source =
avFile.file_url && avFile.file_url.length > 0
? avFile.file_url.split('?')
: '';
const type =
avFile.file_url && avFile.file_url.length > 0
? mime.lookup(source[0])
: undefined;

event.items?.push({
id: `${siteURL}/${snakeCase(
Expand Down

0 comments on commit 2e3f8ca

Please sign in to comment.