file_props.dart 802 B

123456789101112131415161718192021222324
  1. import "package:photos/core/configuration.dart";
  2. import "package:photos/models/file/file.dart";
  3. import "package:photos/models/file/file_type.dart";
  4. import "package:photos/models/file/trash_file.dart";
  5. extension FilePropsExtn on EnteFile {
  6. bool get isLivePhoto => fileType == FileType.livePhoto;
  7. bool get isMotionPhoto => pubMagicMetadata?.mvi != null;
  8. bool get isLiveOrMotionPhoto => isLivePhoto || isMotionPhoto;
  9. bool get isOwner =>
  10. (ownerID == null) || (ownerID! == Configuration.instance.getUserID()!);
  11. bool get canEditMetaInfo => isUploaded && isOwner;
  12. bool get isTrash => this is TrashFile;
  13. // Return true if the file was uploaded via collect photos workflow
  14. bool get isCollect => uploaderName != null;
  15. String? get uploaderName => pubMagicMetadata?.uploaderName;
  16. }