mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-30 23:27:17 +02:00
Inline processDownloadItemParts
This commit is contained in:
@@ -84,9 +84,7 @@ class DownloadItemManager(
|
|||||||
"checkUpdateDownloadQueue: numPartsToGet=$numPartsToGet, nextDownloadItemParts=${nextDownloadItemParts.size}"
|
"checkUpdateDownloadQueue: numPartsToGet=$numPartsToGet, nextDownloadItemParts=${nextDownloadItemParts.size}"
|
||||||
)
|
)
|
||||||
|
|
||||||
if (nextDownloadItemParts.isNotEmpty()) {
|
nextDownloadItemParts.forEach { startInternalDownload(it) }
|
||||||
processDownloadItemParts(nextDownloadItemParts)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (currentDownloadItemParts.size >= maxSimultaneousDownloads) {
|
if (currentDownloadItemParts.size >= maxSimultaneousDownloads) {
|
||||||
break
|
break
|
||||||
@@ -96,11 +94,6 @@ class DownloadItemManager(
|
|||||||
if (currentDownloadItemParts.isNotEmpty()) startWatchingDownloads()
|
if (currentDownloadItemParts.isNotEmpty()) startWatchingDownloads()
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Processes the download item parts. */
|
|
||||||
private fun processDownloadItemParts(nextDownloadItemParts: List<DownloadItemPart>) {
|
|
||||||
nextDownloadItemParts.forEach { startInternalDownload(it) }
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Starts an internal download. */
|
/** Starts an internal download. */
|
||||||
private fun startInternalDownload(downloadItemPart: DownloadItemPart) {
|
private fun startInternalDownload(downloadItemPart: DownloadItemPart) {
|
||||||
// Create internal download location at temp directory location
|
// Create internal download location at temp directory location
|
||||||
|
|||||||
Reference in New Issue
Block a user