Add link to wikipedia-image in the attribution box, fix #1049

This commit is contained in:
Pieter Vander Vennet 2022-08-30 20:29:49 +02:00
parent efd1f5467b
commit c09b437d9a
3 changed files with 16 additions and 3 deletions

View file

@ -8,4 +8,5 @@ export class LicenseInfo {
copyrighted: boolean = false;
credit: string = "";
description: string = "";
informationLocation: URL = undefined
}

View file

@ -129,7 +129,7 @@ export class WikimediaImageProvider extends ImageProvider {
if (pageInfo === undefined) {
return undefined;
}
const license = (pageInfo.imageinfo ?? [])[0]?.extmetadata;
if (license === undefined) {
console.warn("The file", filename, "has no usable metedata or license attached... Please fix the license info file yourself!")
@ -153,6 +153,7 @@ export class WikimediaImageProvider extends ImageProvider {
licenseInfo.licenseShortName = license.LicenseShortName?.value;
licenseInfo.credit = license.Credit?.value;
licenseInfo.description = license.ImageDescription?.value;
licenseInfo.informationLocation = new URL("https://en.wikipedia.org/wiki/"+pageInfo.title)
return licenseInfo;
}