refactor: Ktlint and replace enum.values with Enum.entries.

Signed-off-by: KaiserBh <kaiserbh@proton.me>
This commit is contained in:
KaiserBh 2023-12-29 02:06:43 +11:00
parent ae8b1d8913
commit 440b624903
No known key found for this signature in database
GPG Key ID: 14D73B142042BBA9

View File

@ -22,7 +22,6 @@ import tachiyomi.data.Chapters
import tachiyomi.data.DatabaseHandler import tachiyomi.data.DatabaseHandler
import tachiyomi.data.manga.MangaMapper.mapManga import tachiyomi.data.manga.MangaMapper.mapManga
import tachiyomi.domain.category.interactor.GetCategories import tachiyomi.domain.category.interactor.GetCategories
import tachiyomi.domain.chapter.model.Chapter
import tachiyomi.domain.manga.interactor.GetFavorites import tachiyomi.domain.manga.interactor.GetFavorites
import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.Manga
import tachiyomi.domain.sync.SyncPreferences import tachiyomi.domain.sync.SyncPreferences
@ -61,7 +60,7 @@ class SyncManager(
; ;
companion object { companion object {
fun fromInt(value: Int) = values().firstOrNull { it.value == value } ?: NONE fun fromInt(value: Int) = entries.firstOrNull { it.value == value } ?: NONE
} }
} }
@ -190,7 +189,9 @@ class SyncManager(
val localChapters = handler.await { chaptersQueries.getChaptersByMangaId(localManga.id, 0).executeAsList() } val localChapters = handler.await { chaptersQueries.getChaptersByMangaId(localManga.id, 0).executeAsList() }
val localCategories = getCategories.await(localManga.id).map { it.order } val localCategories = getCategories.await(localManga.id).map { it.order }
return localManga != remoteManga || areChaptersDifferent(localChapters, backupManga.chapters) || localCategories != backupManga.categories return localManga != remoteManga ||
areChaptersDifferent(localChapters, backupManga.chapters) ||
localCategories != backupManga.categories
} }
/** /**