From 3cbab36e82045a642623acf07214a957400464a4 Mon Sep 17 00:00:00 2001 From: Kyle Bolen Date: Tue, 28 Jul 2026 05:56:57 +0000 Subject: [PATCH] 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. --- .../photophetch/device/AndroidConnector.kt | 28 +++++++++++++++---- .../bolenpad/photophetch/util/ExifFilter.kt | 1 - 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/com/bolenpad/photophetch/device/AndroidConnector.kt b/src/main/kotlin/com/bolenpad/photophetch/device/AndroidConnector.kt index 1609019..e1b7152 100644 --- a/src/main/kotlin/com/bolenpad/photophetch/device/AndroidConnector.kt +++ b/src/main/kotlin/com/bolenpad/photophetch/device/AndroidConnector.kt @@ -31,10 +31,25 @@ class AndroidConnector( "/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( - "jpg", "jpeg", "png", "dng", "raw", // photos - "mp4", "mov", "3gp", "avi", // videos + // Photos + "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 { @@ -70,7 +85,7 @@ class AndroidConnector( val serial = requireSerial(device) val photos = mutableListOf() - // 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. val scanRoots = listOf( "/storage/emulated/0/DCIM", @@ -87,6 +102,9 @@ class AndroidConnector( .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 val dirsToScan = cameraDirs.ifEmpty { fallbackCameraDirs } @@ -121,7 +139,7 @@ class AndroidConnector( dateTaken = dateTaken, exifMake = 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, sourceFolder = folderName, ) diff --git a/src/main/kotlin/com/bolenpad/photophetch/util/ExifFilter.kt b/src/main/kotlin/com/bolenpad/photophetch/util/ExifFilter.kt index 7f65dd1..0701d2f 100644 --- a/src/main/kotlin/com/bolenpad/photophetch/util/ExifFilter.kt +++ b/src/main/kotlin/com/bolenpad/photophetch/util/ExifFilter.kt @@ -35,7 +35,6 @@ object ExifFilter { "signal", "viber", "received", - "download", "snapchat", "instagram", "twitter",