decord/source/actions/UserActivityActionCreators.tsx

97 lines
3.1 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 11311
// Function ID: 11312
2026-07-20 16:05:17 +00:00
// Name: _getMetadata
2026-08-25 06:04:03 +00:00
// Dependencies: [5, 4469, 676, 709, 11308, 530, 2]
2026-07-20 16:05:17 +00:00
// Exports: getMetadata, play, sync
2026-08-25 06:04:03 +00:00
// Module 11311 (_getMetadata)
2026-08-24 06:08:38 +00:00
import dispatcherDefault from "dispatcher" /* 709 */;
import closure_3 from "asyncGeneratorStep" /* 5 */;
2026-08-25 06:04:03 +00:00
import closure_4 from "sortActivity" /* 4469 */;
2026-08-24 06:08:38 +00:00
import { Endpoints } from "ME" /* 676 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function _getMetadata() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback((arg0, arg1) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
closure_1 = arg1;
c4 = 0;
c5 = 0;
2026-07-29 08:29:29 +00:00
return (function*(arg0, body) {
2026-08-24 06:08:38 +00:00
closure_3 = tmp3;
2026-08-04 21:03:28 +00:00
const table = tmp2;
const lib = body;
const metadata = lib.metadata;
if (null != metadata) {
const _Object = Object;
if (Object.keys(metadata).length > 0) {
2026-08-24 06:08:38 +00:00
c5 = 3;
obj1 = { value: null, done: true };
2026-08-04 21:03:28 +00:00
obj1[0] = metadata;
return obj1;
2026-07-29 08:29:29 +00:00
}
}
2026-08-04 21:03:28 +00:00
if (null != activityMetadata) {
return activityMetadata;
}
if (null == tmp28.session_id) {
const _Error = Error;
2026-08-24 06:08:38 +00:00
error = new Error("null/undefined session_id");
2026-08-04 21:03:28 +00:00
throw error;
}
2026-08-24 06:08:38 +00:00
const HTTP = lib(closure_1_2[5]).HTTP;
2026-08-04 21:03:28 +00:00
const obj3 = { url: null, oldFormErrors: true, rejectWithError: null };
obj3[0] = c5.USER_ACTIVITY_METADATA(tmp29, tmp28.session_id, tmp28.application_id);
2026-08-24 06:08:38 +00:00
obj3[2] = lib(closure_1_2[5]).rejectWithMigratedError();
2026-08-04 21:03:28 +00:00
yield HTTP.get(obj3);
body = body.body;
const obj = body(table[3]);
const obj6 = { type: "ACTIVITY_METADATA_UPDATE", metadata: null, userId: null };
obj6[1] = body;
obj6[2] = lib;
obj.dispatch(obj6);
return body;
2026-07-29 08:29:29 +00:00
})();
});
2026-08-24 06:08:38 +00:00
closure_6 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("actions/UserActivityActionCreators.tsx");
2026-07-20 16:05:17 +00:00
export const sync = function sync(activity, userId) {
2026-08-24 06:08:38 +00:00
let obj = dispatcherDefault;
2026-07-20 16:05:17 +00:00
obj = { type: "ACTIVITY_SYNC", activity, userId };
obj.dispatch(obj);
};
2026-07-23 10:11:24 +00:00
export const play = function play(closure_0, closure_1) {
const _require = closure_0;
2026-08-25 06:04:03 +00:00
const spotifyMetadataFromActivity = _require(11308).getSpotifyMetadataFromActivity(closure_0, closure_1);
let obj = _require(11308);
2026-07-20 16:05:17 +00:00
spotifyMetadataFromActivity.then((metadata) => {
2026-08-24 06:08:38 +00:00
let obj = callback(closure_1_2[3]);
2026-07-23 10:11:24 +00:00
obj = { type: "ACTIVITY_PLAY", activity: closure_0, userId: callback, metadata };
2026-07-20 16:05:17 +00:00
return obj.dispatch(obj);
}).catch(() => {
2026-08-24 06:08:38 +00:00
let obj = callback(closure_1_2[3]);
2026-07-23 10:11:24 +00:00
obj = { type: "ACTIVITY_PLAY", activity: closure_0, userId: callback };
2026-07-20 16:05:17 +00:00
return obj.dispatch(obj);
});
};
2026-07-29 08:29:29 +00:00
export const getMetadata = function getMetadata() {
const self = this;
const apply = _getMetadata.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
};