decord/beta/source/modules/soundboard/useSoundOrganizer.tsx

64 lines
1.6 KiB
TypeScript
Raw Normal View History

2026-10-07 22:43:51 +00:00
// Module ID: 17231
// Function ID: 17232
// Name: useSoundOrganizer
// Dependencies: [11, 2]
// Exports: sortSoundsOldestToNewestFavoriteDate, useSoundOrganizer
2026-10-07 22:43:51 +00:00
// Module 17231 (useSoundOrganizer)
import SnowflakeUtilsDefault from "SnowflakeUtils" /* 11 */;
import size from "module_2" /* 2 */;
2026-10-09 10:34:53 +00:00
const f129251 = (available, available2) => {
2026-10-01 14:13:23 +00:00
let num;
if (!available.available) {
let num2 = 0;
if (!available.available) {
num2 = 0;
if (available2.available) {
num2 = 1;
}
}
num = num2;
} else {
num = -1;
}
return num;
};
function sortSoundsOldestToNewestCreationDate(arg0) {
let flag = arg1;
if (arg1 === undefined) {
flag = true;
}
const items = [...arg0];
2026-10-01 14:13:23 +00:00
const sorted = items.sort((soundId, soundId2) => {
const obj = SnowflakeUtilsDefault;
return obj.compare(soundId.soundId, soundId2.soundId);
});
let sorted1 = sorted;
if (flag) {
const items1 = [];
2026-10-01 14:13:23 +00:00
HermesBuiltin.arraySpread(items1, sorted, 0);
2026-10-09 10:34:53 +00:00
sorted1 = items1.sort(f129251);
}
return sorted1;
}
const result = size.fileFinishedImporting("modules/soundboard/useSoundOrganizer.tsx");
export { sortSoundsOldestToNewestCreationDate };
export const sortSoundsOldestToNewestFavoriteDate = function sortSoundsOldestToNewestFavoriteDate(arg0) {
let flag = arg1;
if (arg1 === undefined) {
flag = true;
}
let sorted = arg0;
if (flag) {
const items = [];
2026-10-01 14:13:23 +00:00
let num = 0;
HermesBuiltin.arraySpread(items, arg0, 0);
2026-10-09 10:34:53 +00:00
sorted = items.sort(f129251);
}
return sorted;
};
export function useSoundOrganizer() {
return sortSoundsOldestToNewestCreationDate;
}