decord/source/modules/content_inventory/matchUtils.tsx

105 lines
3.4 KiB
TypeScript
Raw Normal View History

2026-07-25 08:10:48 +00:00
// Module ID: 8110
2026-07-27 11:26:19 +00:00
// Function ID: 64656
2026-07-20 16:05:17 +00:00
// Name: isSpotifyEntry
2026-07-25 08:10:48 +00:00
// Dependencies: [653, 8111, 8113, 8114, 8116, 8117, 7853, 2]
2026-07-20 16:05:17 +00:00
// Exports: findMatchingEntry
2026-07-25 08:10:48 +00:00
// Module 8110 (isSpotifyEntry)
2026-07-23 10:11:24 +00:00
import { ActivityTypes } from "ME";
import { CRUNCHYROLL_CLIENT_ID } from "CRUNCHYROLL_LINK_DEST_ORIGIN";
import { isSpotifyParty } from "spotifyUtmParams";
2026-07-20 16:05:17 +00:00
function isSpotifyEntry(extra) {
if (obj.isListenedSessionEntry(extra)) {
const first = extra.extra.entries[0];
let provider;
if (null != first) {
const media = first.media;
if (null != media) {
provider = media.provider;
}
}
2026-07-25 08:10:48 +00:00
let tmp4 = provider === require(8116) /* ContentInventoryListenedMediaProvider */.ContentInventoryListenedMediaProvider.SPOTIFY;
2026-07-20 16:05:17 +00:00
} else {
2026-07-25 08:10:48 +00:00
const tmp3 = !require(8114) /* isPlayedGameEntry */.isTopArtistEntry(extra);
2026-07-20 16:05:17 +00:00
tmp4 = !tmp3;
if (!tmp3) {
2026-07-25 08:10:48 +00:00
tmp4 = extra.extra.media.provider === require(8116) /* ContentInventoryListenedMediaProvider */.ContentInventoryListenedMediaProvider.SPOTIFY;
2026-07-20 16:05:17 +00:00
}
2026-07-25 08:10:48 +00:00
const obj2 = require(8114) /* isPlayedGameEntry */;
2026-07-20 16:05:17 +00:00
}
return tmp4;
}
function isCrunchyrollEntry(extra) {
2026-07-25 08:10:48 +00:00
const tmp = !require(8114) /* isPlayedGameEntry */.isWatchedMediaEntry(extra);
2026-07-20 16:05:17 +00:00
let tmp2 = !tmp;
if (!tmp) {
tmp2 = extra.extra.application_id === CRUNCHYROLL_CLIENT_ID;
}
return tmp2;
}
2026-07-23 10:11:24 +00:00
function isMatchingApplicationActivity(closure_0, type) {
2026-07-20 16:05:17 +00:00
let name = type;
2026-07-23 10:11:24 +00:00
let game_name = closure_0.extra;
2026-07-20 16:05:17 +00:00
let tmp = null != game_name;
if (tmp) {
if ("application_id" in name && name.application_id === game_name.application_id) {
tmp = tmp2;
} else if ("game_name" in game_name) {
name = name.name;
game_name = game_name.game_name;
let tmp3 = name === game_name;
} else {
tmp3 = "activity_name" in game_name && name.name === game_name.activity_name;
}
}
return tmp;
}
2026-07-23 10:11:24 +00:00
function isMatchingListeningActivity(closure_0, party) {
const tmp = isSpotifyEntry(closure_0);
2026-07-20 16:05:17 +00:00
let tmp3Result = tmp;
if (tmp) {
party = party.party;
let id;
if (null != party) {
id = party.id;
}
tmp3Result = isSpotifyParty(id);
const tmp3 = isSpotifyParty;
}
return tmp3Result;
}
2026-07-23 10:11:24 +00:00
function isMatchingWatchActivity(closure_0, details) {
2026-07-25 08:10:48 +00:00
let tmp = !importDefault(8117)(details);
2026-07-20 16:05:17 +00:00
if (!tmp) {
2026-07-23 10:11:24 +00:00
tmp = !isCrunchyrollEntry(closure_0);
2026-07-20 16:05:17 +00:00
}
let tmp3 = !tmp;
if (!tmp) {
2026-07-23 10:11:24 +00:00
tmp3 = closure_0.extra.media_title === details.details;
2026-07-20 16:05:17 +00:00
}
return tmp3;
}
2026-07-23 10:11:24 +00:00
const result = require("spotifyUtmParams").fileFinishedImporting("modules/content_inventory/matchUtils.tsx");
2026-07-20 16:05:17 +00:00
export { isSpotifyEntry };
export { isCrunchyrollEntry };
export { isMatchingApplicationActivity };
export { isMatchingListeningActivity };
export { isMatchingWatchActivity };
export const findMatchingEntry = function findMatchingEntry(entries, activity) {
2026-07-23 10:11:24 +00:00
const _require = activity;
2026-07-25 08:10:48 +00:00
const found = entries.filter(_require(7853).isEntryActive);
2026-07-20 16:05:17 +00:00
if (activity.type === ActivityTypes.PLAYING) {
2026-07-25 08:10:48 +00:00
const found1 = found.filter(_require(8114).isGamingLikeEntry);
2026-07-23 10:11:24 +00:00
let found2 = found1.find((arg0) => outer1_8(arg0, closure_0));
2026-07-20 16:05:17 +00:00
} else if (activity.type === ActivityTypes.LISTENING) {
2026-07-25 08:10:48 +00:00
const found3 = found.filter(_require(8114).isListenedSessionEntry);
2026-07-23 10:11:24 +00:00
found2 = found3.find((arg0) => outer1_9(arg0, closure_0));
2026-07-20 16:05:17 +00:00
} else if (activity.type === ActivityTypes.WATCHING) {
2026-07-25 08:10:48 +00:00
const found4 = entries.filter(_require(8114).isWatchedMediaEntry);
2026-07-23 10:11:24 +00:00
found2 = found4.find((arg0) => outer1_10(arg0, closure_0));
2026-07-20 16:05:17 +00:00
}
return found2;
};