Scan Downloads, expand media extensions to AVIF/HEIF/WEBP/RAW/MKV etc

AndroidConnector:
- Add /storage/emulated/0/Download to scan list (flat dir, no subdirs)
- Expand mediaExtensions: AVIF, HEIF, WEBP, DNG/RAW/ARW/CR2/NEF/ORF,
  TIFF, BMP, MPEG/MPG, M4V, MKV, WEBM, 3G2
- Update video detection set to match

ExifFilter: remove 'download' from excluded fragments so Downloads
folder shows in the Other section rather than being hidden.
This commit is contained in:
Kyle Bolen
2026-07-28 05:56:57 +00:00
parent 60421c9f74
commit 3cbab36e82
2 changed files with 23 additions and 6 deletions

View File

@@ -31,10 +31,25 @@ class AndroidConnector(
"/storage/emulated/0/Pictures/Camera", "/storage/emulated/0/Pictures/Camera",
) )
// Photo/video extensions to include // Photo/video extensions to include — covers all common camera and download formats
private val mediaExtensions = setOf( private val mediaExtensions = setOf(
"jpg", "jpeg", "png", "dng", "raw", // photos // Photos
"mp4", "mov", "3gp", "avi", // videos "jpg", "jpeg",
"heic", "heif",
"avif",
"webp",
"png",
"dng", "raw", "arw", "cr2", "cr3", "nef", "orf", "rw2",
"tiff", "tif",
"bmp",
// Videos
"mp4", "m4v",
"mov",
"mpeg", "mpg", "mpe",
"3gp", "3g2",
"avi",
"mkv",
"webm",
) )
override suspend fun detectDevices(): List<DeviceInfo> { override suspend fun detectDevices(): List<DeviceInfo> {
@@ -70,7 +85,7 @@ class AndroidConnector(
val serial = requireSerial(device) val serial = requireSerial(device)
val photos = mutableListOf<PhonePhoto>() val photos = mutableListOf<PhonePhoto>()
// Scan all subdirectories under DCIM and Pictures. // Scan all subdirectories under DCIM and Pictures, plus Downloads root.
// /sdcard is a symlink to /storage/emulated/0 — scan only the canonical path. // /sdcard is a symlink to /storage/emulated/0 — scan only the canonical path.
val scanRoots = listOf( val scanRoots = listOf(
"/storage/emulated/0/DCIM", "/storage/emulated/0/DCIM",
@@ -87,6 +102,9 @@ class AndroidConnector(
.forEach { subdir -> cameraDirs.add("$root/$subdir") } .forEach { subdir -> cameraDirs.add("$root/$subdir") }
} }
// Downloads is a flat directory (no subdirs worth scanning), add it directly
cameraDirs.add("/storage/emulated/0/Download")
// Fall back to hardcoded list if dynamic discovery found nothing // Fall back to hardcoded list if dynamic discovery found nothing
val dirsToScan = cameraDirs.ifEmpty { fallbackCameraDirs } val dirsToScan = cameraDirs.ifEmpty { fallbackCameraDirs }
@@ -121,7 +139,7 @@ class AndroidConnector(
dateTaken = dateTaken, dateTaken = dateTaken,
exifMake = device.displayName, exifMake = device.displayName,
exifModel = device.displayName, exifModel = device.displayName,
mediaType = if (ext in setOf("mp4", "mov", "3gp", "avi")) mediaType = if (ext in setOf("mp4", "m4v", "mov", "mpeg", "mpg", "mpe", "3gp", "3g2", "avi", "mkv", "webm"))
MediaType.VIDEO else MediaType.PHOTO, MediaType.VIDEO else MediaType.PHOTO,
sourceFolder = folderName, sourceFolder = folderName,
) )

View File

@@ -35,7 +35,6 @@ object ExifFilter {
"signal", "signal",
"viber", "viber",
"received", "received",
"download",
"snapchat", "snapchat",
"instagram", "instagram",
"twitter", "twitter",