Files
discord-decomp/modules/games/getGameMediaRefURL.tsx
T
2026-11-01 12:12:55 +02:00

34 lines
837 B
TypeScript

// Metro module 4219 (f4220).
import * as _StringUtils from "../../utils/StringUtils";
import AvatarUtils from "../../utils/AvatarUtils";
import { getSizedImageProxyURL } from "../image_proxy/ImageProxyUtils";
export default function getGameMediaRefURL(a0, a1, a2) {
if (a1 == null) {
return null;
}
const type = a1.type;
if (type === "hash") {
const isNullOrEmpty = _StringUtils.isNullOrEmpty(a1.value);
let r31 = null;
if (!isNullOrEmpty) {
let r40 = AvatarUtils.getGameAssetURL({
id: a0,
hash: a1.value,
...a2
});
if (r40 == null) {
r40 = null;
}
r31 = r40;
}
return r31;
}
if (type === "url") {
return getSizedImageProxyURL(a1.value, {
size: a2?.size,
keepAspectRatio: a2?.keepAspectRatio
});
}
return null;
};