mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-30 22:07:57 +01:00 
			
		
		
		
	Show number of manga per source in migrate menu (#4703)
This commit is contained in:
		| @@ -27,9 +27,14 @@ class MigrationSourcesPresenter( | ||||
|  | ||||
|     private fun findSourcesWithManga(library: List<Manga>): List<SourceItem> { | ||||
|         val header = SelectionHeader() | ||||
|         return library.asSequence().map { it.source }.toSet() | ||||
|             .mapNotNull { if (it != LocalSource.ID) sourceManager.getOrStub(it) else null } | ||||
|             .sortedBy { it.name.toLowerCase() } | ||||
|             .map { SourceItem(it, header) }.toList() | ||||
|         return library | ||||
|             .groupBy { it.source } | ||||
|             .filterKeys { it != LocalSource.ID } | ||||
|             .map { | ||||
|                 val source = sourceManager.getOrStub(it.key) | ||||
|                 SourceItem(source, it.value.size, header) | ||||
|             } | ||||
|             .sortedBy { it.source.name.toLowerCase() } | ||||
|             .toList() | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -15,7 +15,7 @@ class SourceHolder(view: View, val adapter: SourceAdapter) : | ||||
|     fun bind(item: SourceItem) { | ||||
|         val source = item.source | ||||
|  | ||||
|         binding.title.text = source.name | ||||
|         binding.title.text = "${source.name} (${item.mangaCount})" | ||||
|         binding.subtitle.isVisible = source.lang != "" | ||||
|         binding.subtitle.text = LocaleHelper.getDisplayName(source.lang) | ||||
|  | ||||
|   | ||||
| @@ -14,7 +14,7 @@ import eu.kanade.tachiyomi.source.Source | ||||
|  * @param source Instance of [Source] containing source information. | ||||
|  * @param header The header for this item. | ||||
|  */ | ||||
| data class SourceItem(val source: Source, val header: SelectionHeader) : | ||||
| data class SourceItem(val source: Source, val mangaCount: Int, val header: SelectionHeader) : | ||||
|     AbstractSectionableItem<SourceHolder, SelectionHeader>(header) { | ||||
|  | ||||
|     /** | ||||
|   | ||||
		Reference in New Issue
	
	Block a user