Fix visualisation of licenses

This commit is contained in:
Pieter Vander Vennet 2022-06-13 00:51:53 +02:00
parent e3b9bf2434
commit 771c59ab92
11 changed files with 37 additions and 36 deletions

View file

@ -13,18 +13,6 @@ export default abstract class ImageProvider {
public abstract readonly defaultKeyPrefixes: string[]
private _cache = new Map<string, UIEventSource<LicenseInfo>>()
GetAttributionFor(url: string): UIEventSource<LicenseInfo> {
const cached = this._cache.get(url);
if (cached !== undefined) {
return cached;
}
const src = UIEventSource.FromPromise(this.DownloadAttribution(url))
this._cache.set(url, src)
return src;
}
public abstract SourceIcon(backlinkSource?: string): BaseUIElement;
/**
@ -75,6 +63,6 @@ export default abstract class ImageProvider {
public abstract ExtractUrls(key: string, value: string): Promise<Promise<ProvidedImage>[]>;
protected abstract DownloadAttribution(url: string): Promise<LicenseInfo>;
public abstract DownloadAttribution(url: string): Promise<LicenseInfo>;
}