scan OTG paths only if there is an OTG device connected
This commit is contained in:
parent
0a481e5d57
commit
293d8a7390
1 changed files with 5 additions and 3 deletions
|
@ -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)) {
|
||||||
val newMedia = getMediaOnOTG(curPath, isPickImage, isPickVideo, filterMedia, favoritePaths, getVideoDurations)
|
if (context.hasOTGConnected()) {
|
||||||
curMedia.addAll(newMedia)
|
val newMedia = getMediaOnOTG(curPath, isPickImage, isPickVideo, filterMedia, favoritePaths, getVideoDurations)
|
||||||
|
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)
|
||||||
|
|
Loading…
Reference in a new issue