mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 14:37:59 +01:00
fix some Rename related glitches
This commit is contained in:
parent
302a7842c4
commit
8ff9e7f6ad
2 changed files with 5 additions and 2 deletions
|
@ -148,9 +148,12 @@ fun BaseSimpleActivity.toggleFileVisibility(oldPath: String, hide: Boolean, call
|
|||
filename.substring(1, filename.length)
|
||||
}
|
||||
|
||||
val newPath = "$path$filename"
|
||||
val newPath = "$path/$filename"
|
||||
renameFile(oldPath, newPath) {
|
||||
callback?.invoke(newPath)
|
||||
Thread {
|
||||
updateMediaPath(oldPath, newPath)
|
||||
}.start()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,6 @@ interface MediumDao {
|
|||
@Query("DELETE FROM media WHERE full_path = :path")
|
||||
fun deleteMediumPath(path: String)
|
||||
|
||||
@Query("UPDATE media SET filename = :newFilename, full_path = :newFullPath, parent_path = :newParentPath WHERE full_path = :oldPath")
|
||||
@Query("UPDATE OR REPLACE media SET filename = :newFilename, full_path = :newFullPath, parent_path = :newParentPath WHERE full_path = :oldPath")
|
||||
fun updateMedia(oldPath: String, newParentPath: String, newFilename: String, newFullPath: String)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue