Update linter

This commit is contained in:
arkon
2022-05-10 17:54:52 -04:00
parent 8bee5accb7
commit ae7df4fb7f
49 changed files with 119 additions and 117 deletions
@@ -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