Skip to content

Commit 230ff1d

Browse files
committed
fix: #419
Change-Id: I26a53517c87cd41d953a9f199edafdde57f87674
1 parent 5685845 commit 230ff1d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

source/core/data/src/main/kotlin/com/xayah/core/data/repository/DirectoryRepository.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import com.xayah.core.data.R
66
import com.xayah.core.database.dao.DirectoryDao
77
import com.xayah.core.database.dao.PackageDao
88
import com.xayah.core.datastore.ConstantUtil
9+
import com.xayah.core.datastore.ConstantUtil.DEFAULT_PATH_PARENT
910
import com.xayah.core.datastore.readBackupSavePath
1011
import com.xayah.core.datastore.saveBackupSavePath
1112
import com.xayah.core.model.StorageType
@@ -79,7 +80,10 @@ class DirectoryRepository @Inject constructor(
7980

8081
// Internal storage
8182
val internalList = rootService.listFilePaths(ConstantUtil.STORAGE_EMULATED_PATH, listFiles = false)
82-
.filter { it.substring(it.lastIndexOf("/") + 1).toIntOrNull() != null } // Just select 0 10 999 etc.
83+
.filter { it.substring(it.lastIndexOf("/") + 1).toIntOrNull() != null }.toMutableList() // Just select 0 10 999 etc.
84+
if (internalList.contains(DEFAULT_PATH_PARENT).not()) {
85+
internalList.add(DEFAULT_PATH_PARENT)
86+
}
8387
val internalDirs = mutableListOf<DirectoryUpsertEntity>()
8488
for (storageItem in internalList) {
8589
// e.g. /data/media/0

0 commit comments

Comments
 (0)