Automatic Lint

This commit is contained in:
Syer10
2023-01-16 17:56:06 +00:00
parent de99675969
commit ea791a8bf6
3 changed files with 14 additions and 10 deletions

View File

@@ -31,7 +31,7 @@ import org.lighthousegames.logging.logging
class SourcePager @Inject constructor(
private val getManga: GetManga,
private val serverListeners: ServerListeners,
private val fetcher: suspend (page: Int) -> MangaPage?,
private val fetcher: suspend (page: Int) -> MangaPage?
) : CoroutineScope by CoroutineScope(Dispatchers.Default + SupervisorJob()) {
private val sourceMutex = Mutex()

View File

@@ -107,15 +107,19 @@ class ReaderMenuViewModel @Inject constructor(
?: flowOf(null)
combine(previousChapterPages, chapterPages, nextChapterPages, readerModeSettings.continuous) { prev, cur, next, cont ->
if (cont) {
(prev.orEmpty() +
(
prev.orEmpty() +
ReaderPageSeparator(it.prevChapter, it.currChapter) +
cur.orEmpty() +
ReaderPageSeparator(it.currChapter, it.nextChapter) +
next.orEmpty()).toImmutableList()
next.orEmpty()
).toImmutableList()
} else {
(listOf(ReaderPageSeparator(it.prevChapter, it.currChapter)) +
(
listOf(ReaderPageSeparator(it.prevChapter, it.currChapter)) +
cur.orEmpty() +
ReaderPageSeparator(it.currChapter, it.nextChapter)).toImmutableList()
ReaderPageSeparator(it.currChapter, it.nextChapter)
).toImmutableList()
}
}
}.stateIn(scope, SharingStarted.Eagerly, persistentListOf())
@@ -377,7 +381,6 @@ class ReaderMenuViewModel @Inject constructor(
}
.launchIn(chapter.scope)
}
}
private suspend fun getReaderChapter(chapterIndex: Int): ReaderChapter? {

View File

@@ -89,7 +89,6 @@ class SourceScreenViewModel(
val hasNextPage = pager.flatMapLatest { it.hasNextPage }
.stateIn(scope, SharingStarted.Eagerly, true)
init {
pager.value.loadNextPage()
}
@@ -123,7 +122,8 @@ class SourceScreenViewModel(
getLatestManga.await(
source,
page,
onError = { toast(it.message.orEmpty()) })
onError = { toast(it.message.orEmpty()) }
)
}
}
else -> {
@@ -131,7 +131,8 @@ class SourceScreenViewModel(
getPopularManga.await(
source.id,
page,
onError = { toast(it.message.orEmpty()) })
onError = { toast(it.message.orEmpty()) }
)
}
}
}