mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
scan OTG paths only if there is an OTG device connected
This commit is contained in:
@ -26,9 +26,11 @@ class MediaFetcher(val context: Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val curMedia = ArrayList<Medium>()
|
val curMedia = ArrayList<Medium>()
|
||||||
if (curPath.startsWith(OTG_PATH)) {
|
if (curPath.startsWith(OTG_PATH, true)) {
|
||||||
|
if (context.hasOTGConnected()) {
|
||||||
val newMedia = getMediaOnOTG(curPath, isPickImage, isPickVideo, filterMedia, favoritePaths, getVideoDurations)
|
val newMedia = getMediaOnOTG(curPath, isPickImage, isPickVideo, filterMedia, favoritePaths, getVideoDurations)
|
||||||
curMedia.addAll(newMedia)
|
curMedia.addAll(newMedia)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
val newMedia = getMediaInFolder(curPath, isPickImage, isPickVideo, filterMedia, getProperDateTaken, favoritePaths, getVideoDurations)
|
val newMedia = getMediaInFolder(curPath, isPickImage, isPickVideo, filterMedia, getProperDateTaken, favoritePaths, getVideoDurations)
|
||||||
curMedia.addAll(newMedia)
|
curMedia.addAll(newMedia)
|
||||||
|
Reference in New Issue
Block a user