|
|
@ -84,13 +84,17 @@ class DownloadQueueScreenModel(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
reorder(newDownloads)
|
|
|
|
reorder(newDownloads)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
R.id.move_to_top_series -> {
|
|
|
|
R.id.move_to_top_series, R.id.move_to_bottom_series -> {
|
|
|
|
val (selectedSeries, otherSeries) = adapter?.currentItems
|
|
|
|
val (selectedSeries, otherSeries) = adapter?.currentItems
|
|
|
|
?.filterIsInstance<DownloadItem>()
|
|
|
|
?.filterIsInstance<DownloadItem>()
|
|
|
|
?.map(DownloadItem::download)
|
|
|
|
?.map(DownloadItem::download)
|
|
|
|
?.partition { item.download.manga.id == it.manga.id }
|
|
|
|
?.partition { item.download.manga.id == it.manga.id }
|
|
|
|
?: Pair(emptyList(), emptyList())
|
|
|
|
?: Pair(emptyList(), emptyList())
|
|
|
|
reorder(selectedSeries + otherSeries)
|
|
|
|
if (menuItem.itemId == R.id.move_to_top_series) {
|
|
|
|
|
|
|
|
reorder(selectedSeries + otherSeries)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
reorder(otherSeries + selectedSeries)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
R.id.cancel_download -> {
|
|
|
|
R.id.cancel_download -> {
|
|
|
|
cancel(listOf(item.download))
|
|
|
|
cancel(listOf(item.download))
|
|
|
|