Expand scan to Pictures/ subdirs, add app folder exclusions

AndroidConnector: scan both /storage/emulated/0/DCIM and
/storage/emulated/0/Pictures — all subdirs of each.

ExifFilter: add Slack, Teams, Zoom, Discord, sticker, gif, avatar,
profile, thumbnail, cache to excluded path fragments. These land in
the Other section of the folder panel.
This commit is contained in:
Kyle Bolen
2026-07-28 05:52:09 +00:00
parent 816d818625
commit 60421c9f74
2 changed files with 17 additions and 7 deletions

View File

@@ -70,12 +70,15 @@ class AndroidConnector(
val serial = requireSerial(device) val serial = requireSerial(device)
val photos = mutableListOf<PhonePhoto>() val photos = mutableListOf<PhonePhoto>()
// /sdcard is a symlink to /storage/emulated/0 on most Android devices. // Scan all subdirectories under DCIM and Pictures.
// Scan only /storage/emulated/0/DCIM to avoid listing every photo twice. // /sdcard is a symlink to /storage/emulated/0 — scan only the canonical path.
val dcimRoots = listOf("/storage/emulated/0/DCIM") val scanRoots = listOf(
"/storage/emulated/0/DCIM",
"/storage/emulated/0/Pictures",
)
val cameraDirs = mutableListOf<String>() val cameraDirs = mutableListOf<String>()
for (root in dcimRoots) { for (root in scanRoots) {
val lsOutput = runAdb(serial, "shell", "ls", root, "2>/dev/null") val lsOutput = runAdb(serial, "shell", "ls", root, "2>/dev/null")
if (lsOutput.contains("No such file") || lsOutput.isBlank()) continue if (lsOutput.contains("No such file") || lsOutput.isBlank()) continue
lsOutput.lines() lsOutput.lines()
@@ -84,9 +87,6 @@ class AndroidConnector(
.forEach { subdir -> cameraDirs.add("$root/$subdir") } .forEach { subdir -> cameraDirs.add("$root/$subdir") }
} }
// Also check Pictures/Camera (some Samsung models store there)
cameraDirs.add("/storage/emulated/0/Pictures/Camera")
// 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 }

View File

@@ -41,9 +41,19 @@ object ExifFilter {
"twitter", "twitter",
"facebook", "facebook",
"tiktok", "tiktok",
"slack",
"teams",
"zoom",
"discord",
"share", "share",
"temp", "temp",
"resize", "resize",
"sticker",
"gif",
"avatar",
"profile",
"thumbnail",
"cache",
) )
/** /**