From 6ed48593bd1d7d534fbc9de55b7978385d482f2a Mon Sep 17 00:00:00 2001 From: TheLastGimbus Date: Tue, 12 Sep 2023 01:54:59 +0200 Subject: [PATCH] that should do it workaround for https://github.com/dart-lang/mime/issues/102 fixes #223 (hopefully) --- lib/utils.dart | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/utils.dart b/lib/utils.dart index 86d678e1..b5283ca0 100644 --- a/lib/utils.dart +++ b/lib/utils.dart @@ -30,7 +30,12 @@ extension X on Iterable { /// Easy extension allowing you to filter for files that are photo or video Iterable wherePhotoVideo() => whereType().where((e) { final mime = lookupMimeType(e.path) ?? ""; - return mime.startsWith('image/') || mime.startsWith('video/'); + return mime.startsWith('image/') || + mime.startsWith('video/') || + // https://github.com/TheLastGimbus/GooglePhotosTakeoutHelper/issues/223 + // https://github.com/dart-lang/mime/issues/102 + // 🙃🙃 + mime == 'model/vnd.mts'; }); } @@ -38,7 +43,12 @@ extension Y on Stream { /// Easy extension allowing you to filter for files that are photo or video Stream wherePhotoVideo() => whereType().where((e) { final mime = lookupMimeType(e.path) ?? ""; - return mime.startsWith('image/') || mime.startsWith('video/'); + return mime.startsWith('image/') || + mime.startsWith('video/') || + // https://github.com/TheLastGimbus/GooglePhotosTakeoutHelper/issues/223 + // https://github.com/dart-lang/mime/issues/102 + // 🙃🙃 + mime == 'model/vnd.mts'; }); }