decord/alpha/source/modules/games/getGameMediaRefURL.tsx
github-actions e160b228c5 chore: update source for alpha 348.1
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4942.js (118.4 MB)
2026-09-22 07:41:18 +00:00

52 lines
1.5 KiB
TypeScript

// Module ID: 2009
// Function ID: 2010
// Name: getGameMediaRefURL
// Dependencies: [2010, 1397, 2014, 2]
// Exports: default
// Module 2009 (getGameMediaRefURL)
import AvatarUtilsDefault from "AvatarUtils" /* 1397 */;
import ImageProxyUtils from "ImageProxyUtils" /* 2014 */;
import size from "module_2" /* 2 */;
const result = size.fileFinishedImporting("modules/games/getGameMediaRefURL.tsx");
export default function getGameMediaRefURL(id, type, size) {
if (null == type) {
return null;
} else {
type = type.type;
if ("hash" === type) {
let tmp8 = null;
if (!obj3.isNullOrEmpty(type.value)) {
const obj2 = { id, hash: type.value };
const merged = Object.assign(size);
let gameAssetURL = AvatarUtilsDefault.getGameAssetURL(obj2);
if (gameAssetURL == null) {
gameAssetURL = null;
}
tmp8 = gameAssetURL;
}
return tmp8;
} else if ("url" === type) {
size = undefined;
if (size != null) {
size = size.size;
}
const obj5 = { size, keepAspectRatio: null, format: null };
let keepAspectRatio;
if (size != null) {
keepAspectRatio = size.keepAspectRatio;
}
obj5.keepAspectRatio = keepAspectRatio;
let format;
if (size != null) {
format = size.format;
}
obj5.format = format;
return ImageProxyUtils.getSizedImageAssetURL(type.value, obj5);
} else {
return null;
}
}
};