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

View File

@@ -12,5 +12,5 @@ data class Chapter(
val name: String,
val dateUpload: Long,
val chapterNumber: Float,
val scanlator: String?
val scanlator: String?,
)

View File

@@ -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 {

View File

@@ -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

View File

@@ -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? {

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -5,5 +5,5 @@ import java.util.Date
data class History(
val id: Long?,
val chapterId: Long,
val readAt: Date?
val readAt: Date?,
)

View File

@@ -9,5 +9,5 @@ data class HistoryWithRelations(
val title: String,
val thumbnailUrl: String,
val chapterNumber: Float,
val readAt: Date?
val readAt: Date?,
)

View File

@@ -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>> {

View File

@@ -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

View File

@@ -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) },
),
)
}
}

View File

@@ -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 {

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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