decord/source/modules/games/getGameMediaRefURL.tsx

58 lines
1.6 KiB
TypeScript
Raw Normal View History

// Module ID: 1924
// Function ID: 1925
2026-07-20 16:05:17 +00:00
// Name: getGameMediaRefURL
// Dependencies: [1925, 1396, 1929, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 1924 (getGameMediaRefURL)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
import getAvatarURLDefault from "getAvatarURL" /* 1396 */;
import getSizedImageProxyURL from "getSizedImageProxyURL" /* 1929 */;
2026-08-24 06:08:38 +00:00
const result = set.fileFinishedImporting("modules/games/getGameMediaRefURL.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default function getGameMediaRefURL(arg0, type, size) {
2026-07-20 16:05:17 +00:00
if (null == type) {
return null;
} else {
type = type.type;
if ("hash" === type) {
2026-08-25 06:04:03 +00:00
let tmp8 = null;
2026-07-20 16:05:17 +00:00
if (!obj3.isNullOrEmpty(type.value)) {
2026-07-29 08:29:29 +00:00
let obj = { id: null, hash: null };
obj[0] = arg0;
obj[1] = type.value;
2026-07-20 16:05:17 +00:00
const merged = Object.assign(size);
2026-08-24 06:08:38 +00:00
let gameAssetURL = getAvatarURLDefault.getGameAssetURL(obj);
2026-07-29 08:29:29 +00:00
if (gameAssetURL == null) {
gameAssetURL = null;
2026-07-20 16:05:17 +00:00
}
2026-08-25 06:04:03 +00:00
tmp8 = gameAssetURL;
2026-08-24 06:08:38 +00:00
const obj4 = getAvatarURLDefault;
2026-07-20 16:05:17 +00:00
}
2026-08-25 06:04:03 +00:00
return tmp8;
2026-07-20 16:05:17 +00:00
} else if ("url" === type) {
2026-08-25 06:04:03 +00:00
obj = getSizedImageProxyURL;
2026-07-20 16:05:17 +00:00
size = undefined;
2026-07-29 08:29:29 +00:00
if (size != null) {
2026-07-20 16:05:17 +00:00
size = size.size;
}
2026-08-25 06:04:03 +00:00
obj = { size: null, keepAspectRatio: null, format: null };
2026-07-29 08:29:29 +00:00
obj[0] = size;
2026-07-20 16:05:17 +00:00
let keepAspectRatio;
2026-07-29 08:29:29 +00:00
if (size != null) {
2026-07-20 16:05:17 +00:00
keepAspectRatio = size.keepAspectRatio;
}
2026-07-29 08:29:29 +00:00
obj[1] = keepAspectRatio;
2026-08-25 06:04:03 +00:00
let format;
if (size != null) {
format = size.format;
}
obj[2] = format;
return obj.getSizedImageAssetURL(type.value, obj);
2026-07-20 16:05:17 +00:00
} else {
return null;
}
}
};