Skip to content

Commit

Permalink
downloadUtils: resumeDownloadsOnStart only after opening the app and …
Browse files Browse the repository at this point in the history
…not every recompose
  • Loading branch information
mattcarter11 committed Nov 19, 2024
1 parent 48db064 commit 0ea17c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/com/dd3boh/outertune/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,8 @@ class MainActivity : ComponentActivity() {
val (lookupYtmArtists) = rememberPreference(LookupYtmArtistsKey, defaultValue = true)
val (autoScan) = rememberPreference(AutomaticScannerKey, defaultValue = true)
LaunchedEffect(Unit) {
downloadUtil.resumeDownloadsOnStart(this@MainActivity)

CoroutineScope(Dispatchers.IO).launch {
// Check if the permissions for local media access
if (autoScan && checkSelfPermission(mediaPermissionLevel) == PackageManager.PERMISSION_GRANTED) {
Expand Down Expand Up @@ -1173,8 +1175,6 @@ class MainActivity : ComponentActivity() {
}
}
}

downloadUtil.resumeDownloadsOnStart(this@MainActivity)
}

private fun setSystemBarAppearance(isDark: Boolean) {
Expand Down

0 comments on commit 0ea17c8

Please sign in to comment.