Fix: don't hint on images if they are blacklisted

This commit is contained in:
Pieter Vander Vennet 2025-04-28 01:05:44 +02:00
parent 518a426805
commit 4f419b9321

View file

@ -75,6 +75,7 @@ export default class AllImageProviders {
* AllImageProviders.estimateNumberOfImages({image:"abc", "mapillary": "123", "panoramax:0": "xyz"}) // => 3
* AllImageProviders.estimateNumberOfImages({wikidata:"Q123", "wikipedia": "nl:xyz"}) // => 0
*
* AllImageProviders.estimateNumberOfImages({image:"https://photos.app.goo.gl/tjt5FsQZtpkQRVw38"}) // => 0
*
*/
public static estimateNumberOfImages(
@ -94,7 +95,11 @@ export default class AllImageProviders {
)
for (const prefix of allPrefixes) {
for (const k in tags) {
if (!tags[k]) {
const v = tags[k]
if (!v) {
continue
}
if (AllImageProviders.dontLoadFromPrefixes.some(prefix => v.startsWith(prefix))) {
continue
}
if (k === prefix || k.startsWith(prefix + ":")) {