Skip to content

Commit

Permalink
android: don't show unfinished downloads. Set progress to 1.0f when done
Browse files Browse the repository at this point in the history
  • Loading branch information
a1batross committed Dec 4, 2024
1 parent e731775 commit de1361d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions android/app/src/main/java/su/xash/engine/model/Game.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit de1361d

Please sign in to comment.