mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
android: don't show unfinished downloads. Set progress to 1.0f when done
This commit is contained in:
@@ -108,6 +108,10 @@ class Game(val ctx: Context, val basedir: DocumentFile, var installed: Boolean =
|
||||
}
|
||||
|
||||
fun checkIfGamedir(file: DocumentFile): Boolean {
|
||||
// exclude unfinished downloads
|
||||
if (file.name?.startsWith('.') == true)
|
||||
return false
|
||||
|
||||
file.findFile("liblist.gam")?.let { return true }
|
||||
file.findFile("gameinfo.txt")?.let { return true }
|
||||
return false
|
||||
|
||||
@@ -41,6 +41,8 @@ class FileCopyWorker(ctx: Context, params: WorkerParameters) : CoroutineWorker(c
|
||||
source.copyDirTo(applicationContext, this@FileCopyWorker, target)
|
||||
|
||||
target.renameTo(gamedir)
|
||||
|
||||
setProgress(workDataOf(Progress to 1f))
|
||||
}
|
||||
return Result.success()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user