decord/alpha/source/actions/UserActivityActionCreators.tsx

86 lines
2.9 KiB
TypeScript
Raw Normal View History

2026-10-06 11:16:32 +00:00
// Module ID: 11397
// Function ID: 11398
// Name: UserActivityActionCreators
2026-10-06 11:16:32 +00:00
// Dependencies: [5, 4936, 1085, 584, 11394, 1987, 1282, 2]
2026-07-20 16:05:17 +00:00
// Exports: getMetadata, play, sync
2026-10-06 11:16:32 +00:00
// Module 11397 (UserActivityActionCreators)
2026-10-03 08:58:59 +00:00
import DispatcherDefault from "Dispatcher" /* 584 */;
import Constants from "Constants" /* 1085 */;
import _asyncToGenerator from "_asyncToGenerator" /* 5 */;
2026-10-06 11:16:32 +00:00
import PresenceStore from "PresenceStore" /* 4936 */;
2026-10-03 08:58:59 +00:00
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
const require = globalThis.__r;
2026-10-03 08:58:59 +00:00
let _require, activityMetadata;
2026-10-03 08:58:59 +00:00
let obj = function _getMetadata() {
obj = _asyncToGenerator(async (userId, arg1) => {
let closure_2;
let closure_3;
let closure_1 = arg1;
let c4 = 0;
let c5 = 0;
return (async function(arg0, value) {
let obj11;
userId = closure_1;
const metadata = userId.metadata;
if (null != metadata) {
const _Object = Object;
if (Object.keys(metadata).length > 0) {
c5 = 3;
return { value: metadata, done: true };
}
2026-08-04 21:03:28 +00:00
}
2026-10-03 08:58:59 +00:00
activityMetadata = activityMetadata.getActivityMetadata(tmp24);
if (null != activityMetadata) {
return activityMetadata;
}
if (null == userId.session_id) {
const _Error = Error;
const self = this;
const self2 = this;
const error = new Error("null/undefined session_id");
throw error;
}
const HTTP = require("HTTPUtils").HTTP;
const get = HTTP.get;
const obj6 = { url: Endpoints.USER_ACTIVITY_METADATA(closure_1, userId.session_id, userId.application_id), oldFormErrors: true, rejectWithError: obj11.rejectWithMigratedError() };
obj11 = require("HTTPUtils");
await get(obj6);
const body = value.body;
const obj9 = { type: "ACTIVITY_METADATA_UPDATE", metadata: body, userId };
obj = closure_131_1(closure_131_2[3]);
obj.dispatch(obj9);
return body;
})();
});
return obj(...arguments);
};
2026-10-03 08:58:59 +00:00
const Endpoints = Constants.Endpoints;
const result = size.fileFinishedImporting("actions/UserActivityActionCreators.tsx");
2026-07-20 16:05:17 +00:00
export const sync = function sync(activity, userId) {
2026-10-03 08:58:59 +00:00
obj = DispatcherDefault;
const obj2 = { type: "ACTIVITY_SYNC", activity, userId };
obj.dispatch(obj2);
2026-07-20 16:05:17 +00:00
};
2026-10-06 11:16:32 +00:00
export const play = function play(activity, userId) {
_require = activity;
const promise = require("asyncRequire")(11394, dependencyMap.paths);
const nextPromise = promise.then((getSpotifyMetadataFromActivity) => getSpotifyMetadataFromActivity.getSpotifyMetadataFromActivity(activity, userId));
const nextPromise1 = nextPromise.then((metadata) => {
2026-10-03 08:58:59 +00:00
obj = DispatcherDefault;
const obj2 = { type: "ACTIVITY_PLAY", activity, userId, metadata };
return obj.dispatch(obj2);
});
2026-10-06 11:16:32 +00:00
nextPromise1.catch(() => {
2026-10-03 08:58:59 +00:00
obj = DispatcherDefault;
const obj2 = { type: "ACTIVITY_PLAY", activity, userId };
return obj.dispatch(obj2);
});
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
export const getMetadata = function getMetadata() {
2026-10-03 08:58:59 +00:00
return obj(...arguments);
2026-07-20 16:05:17 +00:00
};