ente/lib/models/ignored_file.dart

32 lines
761 B
Dart
Raw Normal View History

import 'package:photos/models/trash_file.dart';
const kIgnoreReasonTrash = "trash";
class IgnoredFile {
2022-09-23 05:47:23 +00:00
final String? localID;
final String? title;
final String? deviceFolder;
String reason;
2021-10-27 04:33:59 +00:00
IgnoredFile(this.localID, this.title, this.deviceFolder, this.reason);
2022-09-23 05:47:23 +00:00
static fromTrashItem(TrashFile? trashFile) {
if (trashFile == null) return null;
if (trashFile.localID == null ||
2022-09-23 05:47:23 +00:00
trashFile.localID!.isEmpty ||
2021-10-27 04:33:59 +00:00
trashFile.title == null ||
2022-09-23 05:47:23 +00:00
trashFile.title!.isEmpty ||
2021-10-27 04:33:59 +00:00
trashFile.deviceFolder == null ||
2022-09-23 05:47:23 +00:00
trashFile.deviceFolder!.isEmpty) {
return null;
}
2022-06-11 08:23:52 +00:00
return IgnoredFile(
trashFile.localID,
trashFile.title,
trashFile.deviceFolder,
kIgnoreReasonTrash,
);
}
}