fix #971, keep items as Favorites at move
This commit is contained in:
parent
f9000830f5
commit
bb7a911df1
|
@ -527,6 +527,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
config.tempFolderPath = ""
|
config.tempFolderPath = ""
|
||||||
if (!isCopyOperation) {
|
if (!isCopyOperation) {
|
||||||
refreshViewPager()
|
refreshViewPager()
|
||||||
|
updateFavoritePaths(fileDirItems, it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -283,6 +283,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Thumbnai
|
||||||
activity.applicationContext.rescanFolderMedia(fileDirItems.first().getParentPath())
|
activity.applicationContext.rescanFolderMedia(fileDirItems.first().getParentPath())
|
||||||
if (!isCopyOperation) {
|
if (!isCopyOperation) {
|
||||||
listener?.refreshItems()
|
listener?.refreshItems()
|
||||||
|
activity.updateFavoritePaths(fileDirItems, it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -278,3 +278,12 @@ fun BaseSimpleActivity.showRecycleBinEmptyingDialog(callback: () -> Unit) {
|
||||||
callback()
|
callback()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun BaseSimpleActivity.updateFavoritePaths(fileDirItems: ArrayList<FileDirItem>, destination: String) {
|
||||||
|
Thread {
|
||||||
|
fileDirItems.forEach {
|
||||||
|
val newPath = "$destination/${it.name}"
|
||||||
|
updateDBMediaPath(it.path, newPath)
|
||||||
|
}
|
||||||
|
}.start()
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue