decord/alpha/source/modules/device/native/getDeviceMediaPhotos.tsx

55 lines
2 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 10005
// Function ID: 10006
2026-07-20 16:05:17 +00:00
// Name: getDeviceMediaPhotos
2026-10-09 10:00:15 +00:00
// Dependencies: [17, 3, 1255, 1382, 10006, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-10-09 10:00:15 +00:00
// Module 10005 (getDeviceMediaPhotos)
import LoggerDefault from "Logger" /* 3 */;
2026-10-03 08:58:59 +00:00
import react_native from "react-native" /* 17 */;
2026-10-09 10:00:15 +00:00
import SentryUtilsDefault from "SentryUtils" /* 1255 */;
import PlatformUtils from "PlatformUtils" /* 1382 */;
import react_nativeDefault from "react-native" /* 10006 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-10-03 08:58:59 +00:00
const NativeModules = react_native.NativeModules;
let closure_4 = new LoggerDefault("DeviceMedia.tsx");
2026-10-03 08:58:59 +00:00
const tmp2 = new LoggerDefault("DeviceMedia.tsx");
const result = size.fileFinishedImporting("modules/device/native/getDeviceMediaPhotos.tsx");
2026-07-20 16:05:17 +00:00
export default function getDeviceMediaPhotos(arg0) {
2026-10-03 08:58:59 +00:00
let batchSize;
let endCursor;
let extensions;
let lastAssetIndex;
let lastNodeImageUri;
let logger;
let onError;
let onFetched;
2026-07-20 16:05:17 +00:00
({ batchSize, extensions, onFetched, onError } = arg0);
({ endCursor, lastAssetIndex, lastNodeImageUri } = arg0);
if (onError === undefined) {
onError = function u(error) {
logger.log("CameraRollUtils -- Failed to get photos with error " + error);
2026-10-03 08:58:59 +00:00
const obj = SentryUtilsDefault;
obj.captureException(error, { tags: { source: "DEVICE_MEDIA" } });
2026-07-20 16:05:17 +00:00
};
}
2026-10-03 08:58:59 +00:00
let obj = PlatformUtils;
2026-07-20 16:05:17 +00:00
if (obj.isIOS()) {
2026-10-03 08:58:59 +00:00
const obj3 = react_nativeDefault;
2026-07-29 08:29:29 +00:00
if (obj3 != null) {
const obj2 = { first: batchSize, groupTypes: "Recents", assetType: "All", after: endCursor, extensions };
const photos = obj3.getPhotos(obj2);
2026-07-20 16:05:17 +00:00
const nextPromise = photos.then(onFetched);
2026-10-03 08:58:59 +00:00
nextPromise.catch(onError);
2026-07-20 16:05:17 +00:00
}
} else {
const CameraRollUtils = NativeModules.CameraRollUtils;
const obj4 = { first: batchSize, assetType: "All", after: lastNodeImageUri, offset: lastAssetIndex, extensions };
const photos1 = CameraRollUtils.getPhotos(obj4);
2026-07-20 16:05:17 +00:00
const nextPromise1 = photos1.then(onFetched);
2026-10-03 08:58:59 +00:00
nextPromise1.catch(onError);
2026-07-20 16:05:17 +00:00
}
};