mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-31 14:27:57 +01:00 
			
		
		
		
	Add "Move all chapters from series to top" option to download context menu (#6794)
* Added basic move to top series feature * Remove intermediate List * Change text string * Remove spanish manual translation * Changed algorithm to use "partition"
This commit is contained in:
		| @@ -366,6 +366,14 @@ class DownloadController : | ||||
|                     } | ||||
|                     presenter.reorder(newDownloads) | ||||
|                 } | ||||
|                 R.id.move_to_top_series -> { | ||||
|                     val (selectedSeries, otherSeries) = adapter?.currentItems | ||||
|                         ?.filterIsInstance<DownloadItem>() | ||||
|                         ?.map(DownloadItem::download) | ||||
|                         ?.partition { item.download.manga.id == it.manga.id } | ||||
|                         ?: Pair(listOf<Download>(), listOf<Download>()) | ||||
|                     presenter.reorder(selectedSeries + otherSeries) | ||||
|                 } | ||||
|                 R.id.cancel_download -> { | ||||
|                     presenter.cancelDownload(item.download) | ||||
|                 } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user