fix: Keep content-type when using metadata templates

This commit is contained in:
Joachim Van Herwegen
2024-02-14 14:15:35 +01:00
parent a9bcc96217
commit 137027e421
2 changed files with 9 additions and 0 deletions

View File

@@ -197,6 +197,10 @@ export class BaseResourcesGenerator implements TemplatedResourcesGenerator {
// Add metadata from .meta file if there is one
if (metaLink) {
const rawMetadata = await this.generateMetadata(metaLink, options);
if (!rawMetadata.contentType) {
// Make sure this does not remove the content-type if none is explicitly defined
rawMetadata.contentType = metadata.contentType;
}
const metaIdentifier = this.metadataStrategy.getAuxiliaryIdentifier(link.identifier);
const descriptionMeta = new RepresentationMetadata(metaIdentifier);
addResourceMetadata(rawMetadata, isContainerIdentifier(link.identifier));