forked from MapComplete/MapComplete
Fix: fix wikimedia attribution, fix #2332
This commit is contained in:
parent
de2915274d
commit
6c0d54d769
1 changed files with 6 additions and 1 deletions
|
|
@ -138,7 +138,12 @@ export class WikimediaImageProvider extends ImageProvider {
|
||||||
query: { pages: { title: string; imageinfo: { extmetadata }[] }[] }
|
query: { pages: { title: string; imageinfo: { extmetadata }[] }[] }
|
||||||
}>(url, 365 * 24 * 60 * 60)
|
}>(url, 365 * 24 * 60 * 60)
|
||||||
const licenseInfo = new LicenseInfo()
|
const licenseInfo = new LicenseInfo()
|
||||||
const pageInfo = data.query.pages.at(-1)
|
const pages = data.query.pages
|
||||||
|
/*jup, a literal "-1" in an object, not a list!*/
|
||||||
|
let pageInfo = pages["-1"]
|
||||||
|
if (Array.isArray(pages)) {
|
||||||
|
pageInfo = pages.at(-1)
|
||||||
|
}
|
||||||
if (pageInfo === undefined) {
|
if (pageInfo === undefined) {
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue