mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-14 04:58:56 +01:00
Update linter
This commit is contained in:
@@ -12,5 +12,5 @@ data class Chapter(
|
||||
val name: String,
|
||||
val dateUpload: Long,
|
||||
val chapterNumber: Float,
|
||||
val scanlator: String?
|
||||
val scanlator: String?,
|
||||
)
|
||||
|
||||
@@ -3,7 +3,7 @@ package eu.kanade.domain.history.interactor
|
||||
import eu.kanade.domain.history.repository.HistoryRepository
|
||||
|
||||
class DeleteHistoryTable(
|
||||
private val repository: HistoryRepository
|
||||
private val repository: HistoryRepository,
|
||||
) {
|
||||
|
||||
suspend fun await(): Boolean {
|
||||
|
||||
@@ -8,12 +8,12 @@ import eu.kanade.domain.history.repository.HistoryRepository
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
||||
class GetHistory(
|
||||
private val repository: HistoryRepository
|
||||
private val repository: HistoryRepository,
|
||||
) {
|
||||
|
||||
fun subscribe(query: String): Flow<PagingData<HistoryWithRelations>> {
|
||||
return Pager(
|
||||
PagingConfig(pageSize = 25)
|
||||
PagingConfig(pageSize = 25),
|
||||
) {
|
||||
repository.getHistory(query)
|
||||
}.flow
|
||||
|
||||
@@ -4,7 +4,7 @@ import eu.kanade.domain.chapter.model.Chapter
|
||||
import eu.kanade.domain.history.repository.HistoryRepository
|
||||
|
||||
class GetNextChapterForManga(
|
||||
private val repository: HistoryRepository
|
||||
private val repository: HistoryRepository,
|
||||
) {
|
||||
|
||||
suspend fun await(mangaId: Long, chapterId: Long): Chapter? {
|
||||
|
||||
@@ -4,7 +4,7 @@ import eu.kanade.domain.history.model.HistoryWithRelations
|
||||
import eu.kanade.domain.history.repository.HistoryRepository
|
||||
|
||||
class RemoveHistoryById(
|
||||
private val repository: HistoryRepository
|
||||
private val repository: HistoryRepository,
|
||||
) {
|
||||
|
||||
suspend fun await(history: HistoryWithRelations) {
|
||||
|
||||
@@ -3,7 +3,7 @@ package eu.kanade.domain.history.interactor
|
||||
import eu.kanade.domain.history.repository.HistoryRepository
|
||||
|
||||
class RemoveHistoryByMangaId(
|
||||
private val repository: HistoryRepository
|
||||
private val repository: HistoryRepository,
|
||||
) {
|
||||
|
||||
suspend fun await(mangaId: Long) {
|
||||
|
||||
@@ -5,5 +5,5 @@ import java.util.Date
|
||||
data class History(
|
||||
val id: Long?,
|
||||
val chapterId: Long,
|
||||
val readAt: Date?
|
||||
val readAt: Date?,
|
||||
)
|
||||
|
||||
@@ -9,5 +9,5 @@ data class HistoryWithRelations(
|
||||
val title: String,
|
||||
val thumbnailUrl: String,
|
||||
val chapterNumber: Float,
|
||||
val readAt: Date?
|
||||
val readAt: Date?,
|
||||
)
|
||||
|
||||
@@ -5,7 +5,7 @@ import eu.kanade.domain.manga.repository.MangaRepository
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
||||
class GetFavoritesBySourceId(
|
||||
private val mangaRepository: MangaRepository
|
||||
private val mangaRepository: MangaRepository,
|
||||
) {
|
||||
|
||||
fun subscribe(sourceId: Long): Flow<List<Manga>> {
|
||||
|
||||
@@ -17,7 +17,7 @@ data class Manga(
|
||||
val genre: List<String>?,
|
||||
val status: Long,
|
||||
val thumbnailUrl: String?,
|
||||
val initialized: Boolean
|
||||
val initialized: Boolean,
|
||||
) {
|
||||
|
||||
val sorting: Long
|
||||
|
||||
@@ -16,19 +16,19 @@ class GetLanguagesWithSources(
|
||||
return combine(
|
||||
preferences.enabledLanguages().asFlow(),
|
||||
preferences.disabledSources().asFlow(),
|
||||
repository.getOnlineSources()
|
||||
repository.getOnlineSources(),
|
||||
) { enabledLanguage, disabledSource, onlineSources ->
|
||||
val sortedSources = onlineSources.sortedWith(
|
||||
compareBy<Source> { it.id.toString() in disabledSource }
|
||||
.thenBy(String.CASE_INSENSITIVE_ORDER) { it.name }
|
||||
.thenBy(String.CASE_INSENSITIVE_ORDER) { it.name },
|
||||
)
|
||||
|
||||
sortedSources.groupBy { it.lang }
|
||||
.toSortedMap(
|
||||
compareBy(
|
||||
{ it !in enabledLanguage },
|
||||
{ LocaleHelper.getDisplayName(it) }
|
||||
)
|
||||
{ LocaleHelper.getDisplayName(it) },
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,14 +11,14 @@ import java.util.Locale
|
||||
|
||||
class GetSourcesWithFavoriteCount(
|
||||
private val repository: SourceRepository,
|
||||
private val preferences: PreferencesHelper
|
||||
private val preferences: PreferencesHelper,
|
||||
) {
|
||||
|
||||
fun subscribe(): Flow<List<Pair<Source, Long>>> {
|
||||
return combine(
|
||||
preferences.migrationSortingDirection().asFlow(),
|
||||
preferences.migrationSortingMode().asFlow(),
|
||||
repository.getSourcesWithFavoriteCount()
|
||||
repository.getSourcesWithFavoriteCount(),
|
||||
) { direction, mode, list ->
|
||||
list.sortedWith(sortFn(direction, mode))
|
||||
}
|
||||
@@ -26,7 +26,7 @@ class GetSourcesWithFavoriteCount(
|
||||
|
||||
private fun sortFn(
|
||||
direction: SetMigrateSorting.Direction,
|
||||
sorting: SetMigrateSorting.Mode
|
||||
sorting: SetMigrateSorting.Mode,
|
||||
): java.util.Comparator<Pair<Source, Long>> {
|
||||
val locale = Locale.getDefault()
|
||||
val collator = Collator.getInstance(locale).apply {
|
||||
|
||||
@@ -3,7 +3,7 @@ package eu.kanade.domain.source.interactor
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
|
||||
class SetMigrateSorting(
|
||||
private val preferences: PreferencesHelper
|
||||
private val preferences: PreferencesHelper,
|
||||
) {
|
||||
|
||||
fun await(mode: Mode, isAscending: Boolean) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import eu.kanade.tachiyomi.util.preference.minusAssign
|
||||
import eu.kanade.tachiyomi.util.preference.plusAssign
|
||||
|
||||
class ToggleLanguage(
|
||||
val preferences: PreferencesHelper
|
||||
val preferences: PreferencesHelper,
|
||||
) {
|
||||
|
||||
fun await(language: String) {
|
||||
|
||||
@@ -6,7 +6,7 @@ import eu.kanade.tachiyomi.util.preference.minusAssign
|
||||
import eu.kanade.tachiyomi.util.preference.plusAssign
|
||||
|
||||
class ToggleSource(
|
||||
private val preferences: PreferencesHelper
|
||||
private val preferences: PreferencesHelper,
|
||||
) {
|
||||
|
||||
fun await(source: Source) {
|
||||
|
||||
@@ -6,7 +6,7 @@ import eu.kanade.tachiyomi.util.preference.minusAssign
|
||||
import eu.kanade.tachiyomi.util.preference.plusAssign
|
||||
|
||||
class ToggleSourcePin(
|
||||
private val preferences: PreferencesHelper
|
||||
private val preferences: PreferencesHelper,
|
||||
) {
|
||||
|
||||
fun await(source: Source) {
|
||||
|
||||
@@ -13,7 +13,7 @@ data class Source(
|
||||
val name: String,
|
||||
val supportsLatest: Boolean,
|
||||
val pin: Pins = Pins.unpinned,
|
||||
val isUsedLast: Boolean = false
|
||||
val isUsedLast: Boolean = false,
|
||||
) {
|
||||
|
||||
val nameWithLanguage: String
|
||||
|
||||
Reference in New Issue
Block a user