mirror of
https://github.com/mihonapp/mihon.git
synced 2025-10-17 08:39:43 +02:00
Display total chapters on duplicates list items (#1963)
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
package tachiyomi.domain.manga.interactor
|
||||
|
||||
import tachiyomi.domain.manga.model.Manga
|
||||
import tachiyomi.domain.manga.model.MangaWithChapterCount
|
||||
import tachiyomi.domain.manga.repository.MangaRepository
|
||||
|
||||
class GetDuplicateLibraryManga(
|
||||
private val mangaRepository: MangaRepository,
|
||||
) {
|
||||
|
||||
suspend operator fun invoke(manga: Manga): List<Manga> {
|
||||
suspend operator fun invoke(manga: Manga): List<MangaWithChapterCount> {
|
||||
return mangaRepository.getDuplicateLibraryManga(manga.id, manga.title.lowercase())
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,6 @@
|
||||
package tachiyomi.domain.manga.model
|
||||
|
||||
data class MangaWithChapterCount(
|
||||
val manga: Manga,
|
||||
val chapterCount: Long,
|
||||
)
|
@@ -4,6 +4,7 @@ import kotlinx.coroutines.flow.Flow
|
||||
import tachiyomi.domain.library.model.LibraryManga
|
||||
import tachiyomi.domain.manga.model.Manga
|
||||
import tachiyomi.domain.manga.model.MangaUpdate
|
||||
import tachiyomi.domain.manga.model.MangaWithChapterCount
|
||||
|
||||
interface MangaRepository {
|
||||
|
||||
@@ -25,7 +26,7 @@ interface MangaRepository {
|
||||
|
||||
fun getFavoritesBySourceId(sourceId: Long): Flow<List<Manga>>
|
||||
|
||||
suspend fun getDuplicateLibraryManga(id: Long, title: String): List<Manga>
|
||||
suspend fun getDuplicateLibraryManga(id: Long, title: String): List<MangaWithChapterCount>
|
||||
|
||||
suspend fun getUpcomingManga(statuses: Set<Long>): Flow<List<Manga>>
|
||||
|
||||
|
Reference in New Issue
Block a user