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

43 lines
1.7 KiB
TypeScript
Raw Normal View History

// Module ID: 10888
// Function ID: 10889
2026-07-20 16:05:17 +00:00
// Name: getDeviceMediaPhotos
// Dependencies: [17, 3, 1231, 1364, 10889, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 10888 (getDeviceMediaPhotos)
import LoggerDefault from "Logger" /* 3 */;
import _mod17 from "module_17" /* 17 */;
import SentryUtilsDefault from "SentryUtils" /* 1231 */;
import DCDPhotosDefault from "DCDPhotos" /* 10889 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
const NativeModules = _mod17.NativeModules;
let closure_4 = 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) {
({ 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);
SentryUtilsDefault.captureException(error, { tags: { source: "DEVICE_MEDIA" } });
2026-07-20 16:05:17 +00:00
};
}
if (obj.isIOS()) {
const obj3 = DCDPhotosDefault;
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
photos.then(onFetched).catch(onError);
const nextPromise = photos.then(onFetched);
}
} 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
photos1.then(onFetched).catch(onError);
const nextPromise1 = photos1.then(onFetched);
}
};