Refactoring: image providers use ID everywhere

This commit is contained in:
Pieter Vander Vennet 2025-06-05 12:21:38 +02:00
parent d9c1fe3f74
commit 1ddfffcee0
6 changed files with 19 additions and 20 deletions

View file

@ -124,8 +124,7 @@ export default abstract class ImageProvider {
): undefined | ProvidedImage[] | Promise<ProvidedImage[]>
public abstract DownloadAttribution(providedImage: {
url: string
id?: string
id: string
}): Promise<LicenseInfo>
public abstract apiUrls(): string[]
@ -142,7 +141,7 @@ export default abstract class ImageProvider {
id: string
}): Promise<Feature<Point, PanoramaView>> | undefined
public static async offerImageAsDownload(image: ProvidedImage) {
public static async offerImageAsDownload(image: { url_hd?: string, url: string }) {
const response = await fetch(image.url_hd ?? image.url)
const blob = await response.blob()
Utils.offerContentsAsDownloadableFile(blob, new URL(image.url).pathname.split("/").at(-1), {