decord/source/modules/device/native/getDeviceMediaPhotos.tsx
github-actions 8d58bae3b2 chore: update source for alpha 347.4
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4907.js (118.4 MB)
2026-09-18 06:58:00 +00:00

42 lines
1.7 KiB
TypeScript

// Module ID: 10888
// Function ID: 10889
// Name: getDeviceMediaPhotos
// Dependencies: [17, 3, 1231, 1364, 10889, 2]
// 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 */;
const NativeModules = _mod17.NativeModules;
let closure_4 = new LoggerDefault("DeviceMedia.tsx");
const result = size.fileFinishedImporting("modules/device/native/getDeviceMediaPhotos.tsx");
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" } });
};
}
if (obj.isIOS()) {
const obj3 = DCDPhotosDefault;
if (obj3 != null) {
const obj2 = { first: batchSize, groupTypes: "Recents", assetType: "All", after: endCursor, extensions };
const photos = obj3.getPhotos(obj2);
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);
photos1.then(onFetched).catch(onError);
const nextPromise1 = photos1.then(onFetched);
}
};