mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-17 10:53:57 +01:00
apply correct media prefixes
This commit is contained in:
1 parent
3c92ab3a19
commit
cca46957bc
4 files changed
+21
-7
No files matched your search
@@ -36,6 +36,16 @@ export class ServerAPI extends AbstractAPI {
|
||||
super();
|
||||
}
|
||||
|
||||
mediaPrefix(path: string) {
|
||||
const config = this.resolveClientConfig();
|
||||
const metroResources = config.MetroResources();
|
||||
const remoteStorage = this.resolveRemoteUrl(
|
||||
metroResources.remote_storage!.remote_urls,
|
||||
);
|
||||
|
||||
return `${remoteStorage.url}/${remoteStorage.relative_path}${path}`;
|
||||
}
|
||||
|
||||
resolveRemoteUrl(remoteUrls: string[]) {
|
||||
let remoteStorage: RemoteStorageComponent | undefined = undefined;
|
||||
|
||||
@@ -380,12 +390,7 @@ export class ServerAPI extends AbstractAPI {
|
||||
async currencyIcon(id: string) {
|
||||
const item = this.metadata.item(`CurrencyEntity.${id}`);
|
||||
const stuffUI = item.StuffUI("UIComponent");
|
||||
const config = this.resolveClientConfig();
|
||||
const metroResources = config.MetroResources();
|
||||
const remoteStorage = this.resolveRemoteUrl(
|
||||
metroResources.remote_storage!.remote_urls,
|
||||
);
|
||||
|
||||
return `${remoteStorage.url}/${remoteStorage.relative_path}${stuffUI.icon!.value}`;
|
||||
return this.mediaPrefix(stuffUI.icon!.value);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user