decord/source/actions/UserActivityActionCreators.tsx

96 lines
3 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 11037
// Function ID: 11038
2026-07-20 16:05:17 +00:00
// Name: _getMetadata
2026-08-05 07:35:12 +00:00
// Dependencies: [5, 4341, 676, 709, 11034, 530, 2]
2026-07-20 16:05:17 +00:00
// Exports: getMetadata, play, sync
2026-08-05 07:35:12 +00:00
// Module 11037 (_getMetadata)
2026-07-29 08:29:29 +00:00
import sendRequest from "sendRequest";
import sortActivity from "sortActivity";
2026-07-23 10:11:24 +00:00
import { Endpoints } from "ME";
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) => {
let closure_0 = arg0;
let closure_1 = arg1;
let c4 = 0;
let c5 = 0;
return (function*(arg0, body) {
2026-08-04 21:03:28 +00:00
let sendRequest = tmp3;
const table = tmp2;
const lib = body;
const metadata = lib.metadata;
if (null != metadata) {
const _Object = Object;
if (Object.keys(metadata).length > 0) {
let c5 = 3;
const obj1 = { value: null, done: true };
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;
const error = new Error("null/undefined session_id");
throw error;
}
const HTTP = lib(outer1_2[5]).HTTP;
const obj3 = { url: null, oldFormErrors: true, rejectWithError: null };
obj3[0] = c5.USER_ACTIVITY_METADATA(tmp29, tmp28.session_id, tmp28.application_id);
obj3[2] = lib(outer1_2[5]).rejectWithMigratedError();
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
})();
});
const _getMetadata = tmp;
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-07-23 10:11:24 +00:00
const result = require("ME").fileFinishedImporting("actions/UserActivityActionCreators.tsx");
2026-07-20 16:05:17 +00:00
export const sync = function sync(activity, userId) {
2026-07-29 08:29:29 +00:00
let obj = importDefault(709);
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-05 07:35:12 +00:00
const spotifyMetadataFromActivity = _require(11034).getSpotifyMetadataFromActivity(closure_0, closure_1);
let obj = _require(11034);
2026-07-20 16:05:17 +00:00
spotifyMetadataFromActivity.then((metadata) => {
2026-07-23 10:11:24 +00:00
let obj = callback(outer1_2[3]);
obj = { type: "ACTIVITY_PLAY", activity: closure_0, userId: callback, metadata };
2026-07-20 16:05:17 +00:00
return obj.dispatch(obj);
}).catch(() => {
2026-07-23 10:11:24 +00:00
let obj = callback(outer1_2[3]);
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
};