mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-15 15:02:49 +01:00
refactor: Ktlint and replace enum.values with Enum.entries.
Signed-off-by: KaiserBh <kaiserbh@proton.me>
This commit is contained in:
parent
ae8b1d8913
commit
440b624903
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user