mirror of
https://github.com/ultrasonic/ultrasonic
synced 2025-03-12 01:20:12 +01:00
Remove unneccessary call to checkDownloads() which were interferring with AutoPlay somehow.
This commit is contained in:
parent
6f676d20b0
commit
24092ce465
@ -162,10 +162,14 @@ class Downloader(
|
||||
}
|
||||
|
||||
if (listChanged) {
|
||||
observableList.postValue(downloads)
|
||||
updateLiveData()
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateLiveData() {
|
||||
observableList.postValue(downloads)
|
||||
}
|
||||
|
||||
private fun startDownloadOnService(task: DownloadFile) {
|
||||
MediaPlayerService.executeOnStartedMediaPlayerService {
|
||||
task.download()
|
||||
@ -254,12 +258,14 @@ class Downloader(
|
||||
|
||||
// Cancel all active downloads with a high priority
|
||||
for (download in activelyDownloading) {
|
||||
if (download.priority < 100)
|
||||
if (download.priority < 100) {
|
||||
download.cancelDownload()
|
||||
activelyDownloading.remove(download)
|
||||
}
|
||||
}
|
||||
|
||||
playlistUpdateRevision++
|
||||
checkDownloads()
|
||||
updateLiveData()
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
@ -269,18 +275,21 @@ class Downloader(
|
||||
|
||||
// Cancel all active downloads with a low priority
|
||||
for (download in activelyDownloading) {
|
||||
if (download.priority >= 100)
|
||||
if (download.priority >= 100) {
|
||||
download.cancelDownload()
|
||||
activelyDownloading.remove(download)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
fun clearActiveDownloads() {
|
||||
// Cancel all active downloads with a low priority
|
||||
// Cancel all active downloads
|
||||
for (download in activelyDownloading) {
|
||||
download.cancelDownload()
|
||||
}
|
||||
checkDownloads()
|
||||
activelyDownloading.clear()
|
||||
updateLiveData()
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
|
Loading…
x
Reference in New Issue
Block a user