Files
discord-decomp/utils/GIFPickerUtils.tsx
T
2026-11-01 12:12:55 +02:00

47 lines
1.1 KiB
TypeScript

// Metro module 9598 (f9599).
import { SearchTypes } from "../Constants";
export function isKlipyProvider(a0) {
return a0 === "Klipy";
}
export function shouldUseAnimatedWebPThumbnail(a0) {
return a0 === "Klipy";
}
export function getGIFThumbnailForFavorite(a0) {
if (a0.providerName === "Klipy") {
const thumbnail = a0.thumbnail;
if (thumbnail != null) {
let proxyURL = thumbnail.proxyURL;
if (proxyURL == null) {
proxyURL = thumbnail.url;
}
if (proxyURL == null) {
proxyURL = thumbnail.uri;
}
return proxyURL;
}
}
}
export function calculateAnalyticsMetadata(a0, a1, a2) {
let modifiers;
if (a1 != null) {
const r2 = {};
r2[a1] = 1;
modifiers = r2;
} else {
modifiers = {};
}
const r12 = a2 == null ? {} : a2;
const { offset, limit, results, totalResults } = r12;
return {
search_type: SearchTypes.GIF,
load_id: a0,
limit,
offset,
page: limit != null ? offset != null ? Math.floor(offset / limit) + 1 : 1 : 1,
total_results: totalResults,
page_results: results ?? null,
num_modifiers: Object.keys(modifiers).length,
modifiers
};
}