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) {
|
if (listChanged) {
|
||||||
observableList.postValue(downloads)
|
updateLiveData()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun updateLiveData() {
|
||||||
|
observableList.postValue(downloads)
|
||||||
|
}
|
||||||
|
|
||||||
private fun startDownloadOnService(task: DownloadFile) {
|
private fun startDownloadOnService(task: DownloadFile) {
|
||||||
MediaPlayerService.executeOnStartedMediaPlayerService {
|
MediaPlayerService.executeOnStartedMediaPlayerService {
|
||||||
task.download()
|
task.download()
|
||||||
|
@ -254,12 +258,14 @@ class Downloader(
|
||||||
|
|
||||||
// Cancel all active downloads with a high priority
|
// Cancel all active downloads with a high priority
|
||||||
for (download in activelyDownloading) {
|
for (download in activelyDownloading) {
|
||||||
if (download.priority < 100)
|
if (download.priority < 100) {
|
||||||
download.cancelDownload()
|
download.cancelDownload()
|
||||||
|
activelyDownloading.remove(download)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
playlistUpdateRevision++
|
playlistUpdateRevision++
|
||||||
checkDownloads()
|
updateLiveData()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Synchronized
|
@Synchronized
|
||||||
|
@ -269,18 +275,21 @@ class Downloader(
|
||||||
|
|
||||||
// Cancel all active downloads with a low priority
|
// Cancel all active downloads with a low priority
|
||||||
for (download in activelyDownloading) {
|
for (download in activelyDownloading) {
|
||||||
if (download.priority >= 100)
|
if (download.priority >= 100) {
|
||||||
download.cancelDownload()
|
download.cancelDownload()
|
||||||
|
activelyDownloading.remove(download)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Synchronized
|
@Synchronized
|
||||||
fun clearActiveDownloads() {
|
fun clearActiveDownloads() {
|
||||||
// Cancel all active downloads with a low priority
|
// Cancel all active downloads
|
||||||
for (download in activelyDownloading) {
|
for (download in activelyDownloading) {
|
||||||
download.cancelDownload()
|
download.cancelDownload()
|
||||||
}
|
}
|
||||||
checkDownloads()
|
activelyDownloading.clear()
|
||||||
|
updateLiveData()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Synchronized
|
@Synchronized
|
||||||
|
|
Loading…
Reference in New Issue