More SQLDelight migrations
This commit is contained in:
@@ -4,10 +4,14 @@ import eu.kanade.domain.manga.model.Manga
|
||||
import eu.kanade.domain.manga.repository.MangaRepository
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
||||
class GetFavoritesBySourceId(
|
||||
class GetFavorites(
|
||||
private val mangaRepository: MangaRepository,
|
||||
) {
|
||||
|
||||
suspend fun await(): List<Manga> {
|
||||
return mangaRepository.getFavorites()
|
||||
}
|
||||
|
||||
fun subscribe(sourceId: Long): Flow<List<Manga>> {
|
||||
return mangaRepository.getFavoritesBySourceId(sourceId)
|
||||
}
|
||||
@@ -31,9 +31,6 @@ data class Manga(
|
||||
val initialized: Boolean,
|
||||
) {
|
||||
|
||||
val sorting: Long
|
||||
get() = chapterFlags and CHAPTER_SORTING_MASK
|
||||
|
||||
fun toSManga(): SManga {
|
||||
return SManga.create().also {
|
||||
it.url = url
|
||||
@@ -48,6 +45,9 @@ data class Manga(
|
||||
}
|
||||
}
|
||||
|
||||
val sorting: Long
|
||||
get() = chapterFlags and CHAPTER_SORTING_MASK
|
||||
|
||||
val displayMode: Long
|
||||
get() = chapterFlags and CHAPTER_DISPLAY_MASK
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ interface MangaRepository {
|
||||
|
||||
suspend fun getMangaByIdAsFlow(id: Long): Flow<Manga>
|
||||
|
||||
suspend fun getFavorites(): List<Manga>
|
||||
|
||||
fun getFavoritesBySourceId(sourceId: Long): Flow<List<Manga>>
|
||||
|
||||
suspend fun getDuplicateLibraryManga(title: String, sourceId: Long): Manga?
|
||||
|
||||
Reference in New Issue
Block a user