decord/source/utils/GIFPickerUtils.tsx

68 lines
1.8 KiB
TypeScript
Raw Normal View History

2026-07-31 08:44:05 +00:00
// Module ID: 9610
// Function ID: 9611
2026-07-20 16:05:17 +00:00
// Name: isKlipyProvider
2026-07-29 08:29:29 +00:00
// Dependencies: [676, 2]
// Exports: calculateAnalyticsMetadata, getGIFThumbnailForFavorite, isKlipyProvider, shouldUseAnimatedWebPThumbnail
2026-07-20 16:05:17 +00:00
2026-07-31 08:44:05 +00:00
// Module 9610 (isKlipyProvider)
2026-07-23 10:11:24 +00:00
import { SearchTypes } from "ME";
const result = require("set").fileFinishedImporting("utils/GIFPickerUtils.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export function isKlipyProvider(arg0) {
return "Klipy" === arg0;
}
export function shouldUseAnimatedWebPThumbnail(arg0) {
return "Klipy" === arg0;
}
2026-07-20 16:05:17 +00:00
export const getGIFThumbnailForFavorite = function getGIFThumbnailForFavorite(providerName) {
2026-07-29 08:29:29 +00:00
if ("Klipy" === providerName.providerName) {
2026-07-20 16:05:17 +00:00
const thumbnail = providerName.thumbnail;
if (null != thumbnail) {
let uri = thumbnail.proxyURL;
2026-07-29 08:29:29 +00:00
if (uri == null) {
2026-07-20 16:05:17 +00:00
uri = thumbnail.url;
}
2026-07-29 08:29:29 +00:00
if (uri == null) {
2026-07-20 16:05:17 +00:00
uri = thumbnail.uri;
}
return uri;
}
}
};
2026-07-29 08:29:29 +00:00
export const calculateAnalyticsMetadata = function calculateAnalyticsMetadata(analyticsID, TRENDING_GIFS, arg2) {
2026-07-20 16:05:17 +00:00
let limit;
let offset;
let results;
2026-07-29 08:29:29 +00:00
if (null != TRENDING_GIFS) {
let obj = {};
obj[TRENDING_GIFS] = 1;
2026-07-20 16:05:17 +00:00
} else {
obj = {};
}
2026-07-29 08:29:29 +00:00
obj = arg2;
if (arg2 == null) {
2026-07-20 16:05:17 +00:00
obj = {};
}
({ offset, limit, results } = obj);
2026-07-29 08:29:29 +00:00
const obj1 = { search_type: SearchTypes.GIF, load_id: analyticsID, limit, offset, page: null, total_results: null, page_results: null, num_modifiers: null, modifiers: null };
2026-07-20 16:05:17 +00:00
let num2 = 1;
if (null != limit) {
num2 = 1;
if (null != offset) {
const _Math = Math;
num2 = Math.floor(offset / limit) + 1;
}
}
2026-07-29 08:29:29 +00:00
obj1[4] = num2;
obj1[5] = obj.totalResults;
2026-07-20 16:05:17 +00:00
let tmp2 = null;
if (null != results) {
tmp2 = results;
}
2026-07-29 08:29:29 +00:00
obj1[6] = tmp2;
obj1[7] = Object.keys(obj).length;
obj1[8] = obj;
2026-07-20 16:05:17 +00:00
return obj1;
};