mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
android: delete .nomedia if it's a directory
This commit is contained in:
@@ -30,6 +30,16 @@ object Nomedia {
|
||||
|
||||
val nomediaFile = File(directory, ".nomedia")
|
||||
|
||||
// if the .nomedia is directory, remove it
|
||||
if (nomediaFile.isDirectory) {
|
||||
// it should be empty to be deleted, but that's good
|
||||
// because this way we're not deleting something important
|
||||
// (who would stash important files in .nomedia directory though...)
|
||||
if (!nomediaFile.delete()) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// it returns false if file already exists, which is fine for us
|
||||
nomediaFile.createNewFile()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user