Make syncChaptersWithSource use sqldelight (#7263)
* Make `syncChaptersWithSource` use sqldelight Will break chapter list live update on current ui Co-Authored-By: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com> * Review Changes Co-authored-by: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import eu.kanade.tachiyomi.source.model.SManga
|
||||
import eu.kanade.tachiyomi.ui.reader.setting.OrientationType
|
||||
import eu.kanade.tachiyomi.ui.reader.setting.ReadingModeType
|
||||
import tachiyomi.source.model.MangaInfo
|
||||
import eu.kanade.domain.manga.model.Manga as DomainManga
|
||||
|
||||
interface Manga : SManga {
|
||||
|
||||
@@ -128,3 +129,26 @@ fun Manga.toMangaInfo(): MangaInfo {
|
||||
title = this.title,
|
||||
)
|
||||
}
|
||||
|
||||
fun Manga.toDomainManga(): DomainManga? {
|
||||
val mangaId = id ?: return null
|
||||
return DomainManga(
|
||||
id = mangaId,
|
||||
source = source,
|
||||
favorite = favorite,
|
||||
lastUpdate = last_update,
|
||||
dateAdded = date_added,
|
||||
viewerFlags = viewer_flags.toLong(),
|
||||
chapterFlags = chapter_flags.toLong(),
|
||||
coverLastModified = cover_last_modified,
|
||||
url = url,
|
||||
title = title,
|
||||
artist = artist,
|
||||
author = author,
|
||||
description = description,
|
||||
genre = getGenres(),
|
||||
status = status.toLong(),
|
||||
thumbnailUrl = thumbnail_url,
|
||||
initialized = initialized,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user