mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-30 00:17:58 +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)
|
filename.substring(1, filename.length)
|
||||||
}
|
}
|
||||||
|
|
||||||
val newPath = "$path$filename"
|
val newPath = "$path/$filename"
|
||||||
renameFile(oldPath, newPath) {
|
renameFile(oldPath, newPath) {
|
||||||
callback?.invoke(newPath)
|
callback?.invoke(newPath)
|
||||||
|
Thread {
|
||||||
|
updateMediaPath(oldPath, newPath)
|
||||||
|
}.start()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,6 @@ interface MediumDao {
|
||||||
@Query("DELETE FROM media WHERE full_path = :path")
|
@Query("DELETE FROM media WHERE full_path = :path")
|
||||||
fun deleteMediumPath(path: String)
|
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)
|
fun updateMedia(oldPath: String, newParentPath: String, newFilename: String, newFullPath: String)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue