This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,13 @@
// Metro module 11298 (f11299).
import { Endpoints } from "../../../Constants";
import { getBestMediaProxySize, getDevicePixelRatio } from "../../image_upload/ImageLoaderUtils";
import { SUPPORTS_WEBP } from "../../../utils/AvatarUtils";
const GLOBAL_ENV = window.GLOBAL_ENV;
const { API_ENDPOINT, CDN_HOST } = GLOBAL_ENV;
export function getCollectionItemAssetUrl({ itemId, hash, containerWidth = 1024 }) {
const r11 = new URLSearchParams({
size: getBestMediaProxySize(containerWidth * getDevicePixelRatio()).toString()
}).toString();
const r10 = SUPPORTS_WEBP ? "webp" : "png";
return CDN_HOST != null ? `https://${CDN_HOST}/app-assets/application-directory/collection-items/${itemId}/${hash}.${r10}?${r11}` : `${location.protocol}${API_ENDPOINT}${Endpoints.APPLICATION_DIRECTORY_COLLECTION_ITEM_IMAGE(itemId, hash, r10)}?${r11}`;
}