mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 22:30:30 +05:30
Merge pull request #4860 from Bnyro/master
fix: buggy icon to pause download
This commit is contained in:
commit
3845e9451a
@ -245,11 +245,14 @@ class DownloadService : LifecycleService() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setPauseNotification(notificationBuilder, item, completed)
|
setPauseNotification(notificationBuilder, item, completed)
|
||||||
pause(item.id)
|
|
||||||
|
downloadQueue[item.id] = false
|
||||||
|
|
||||||
if (_downloadFlow.firstOrNull { it.first == item.id }?.second == DownloadStatus.Stopped) {
|
if (_downloadFlow.firstOrNull { it.first == item.id }?.second == DownloadStatus.Stopped) {
|
||||||
downloadQueue.remove(item.id, false)
|
downloadQueue.remove(item.id, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stopServiceIfDone()
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun startConnection(
|
private suspend fun startConnection(
|
||||||
@ -331,6 +334,10 @@ class DownloadService : LifecycleService() {
|
|||||||
fun pause(id: Int) {
|
fun pause(id: Int) {
|
||||||
downloadQueue[id] = false
|
downloadQueue[id] = false
|
||||||
|
|
||||||
|
lifecycleScope.launch(coroutineContext) {
|
||||||
|
_downloadFlow.emit(id to DownloadStatus.Paused)
|
||||||
|
}
|
||||||
|
|
||||||
stopServiceIfDone()
|
stopServiceIfDone()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user