mirror of
https://github.com/Suwayomi/TachideskJUI.git
synced 2025-12-10 06:42:05 +01:00
Automatic Lint
This commit is contained in:
@@ -18,7 +18,6 @@ fun String.chop(count: Int, replacement: String = "…"): String {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fun String.addSuffix(char: Char): String {
|
fun String.addSuffix(char: Char): String {
|
||||||
return if (endsWith(char)) {
|
return if (endsWith(char)) {
|
||||||
this
|
this
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class UpdateChapterBookmarked @Inject constructor(private val chapterRepository:
|
|||||||
suspend fun await(
|
suspend fun await(
|
||||||
mangaId: Long,
|
mangaId: Long,
|
||||||
index: Int,
|
index: Int,
|
||||||
bookmarked: Boolean,
|
bookmarked: Boolean
|
||||||
) = asFlow(mangaId, index, bookmarked)
|
) = asFlow(mangaId, index, bookmarked)
|
||||||
.catch { log.warn(it) { "Failed to update chapter bookmark for chapter $index of $mangaId" } }
|
.catch { log.warn(it) { "Failed to update chapter bookmark for chapter $index of $mangaId" } }
|
||||||
.collect()
|
.collect()
|
||||||
@@ -27,14 +27,14 @@ class UpdateChapterBookmarked @Inject constructor(private val chapterRepository:
|
|||||||
suspend fun await(
|
suspend fun await(
|
||||||
manga: Manga,
|
manga: Manga,
|
||||||
index: Int,
|
index: Int,
|
||||||
bookmarked: Boolean,
|
bookmarked: Boolean
|
||||||
) = asFlow(manga, index, bookmarked)
|
) = asFlow(manga, index, bookmarked)
|
||||||
.catch { log.warn(it) { "Failed to update chapter bookmark for chapter $index of ${manga.title}(${manga.id})" } }
|
.catch { log.warn(it) { "Failed to update chapter bookmark for chapter $index of ${manga.title}(${manga.id})" } }
|
||||||
.collect()
|
.collect()
|
||||||
|
|
||||||
suspend fun await(
|
suspend fun await(
|
||||||
chapter: Chapter,
|
chapter: Chapter,
|
||||||
bookmarked: Boolean,
|
bookmarked: Boolean
|
||||||
) = asFlow(chapter, bookmarked)
|
) = asFlow(chapter, bookmarked)
|
||||||
.catch { log.warn(it) { "Failed to update chapter bookmark for chapter ${chapter.index} of ${chapter.mangaId}" } }
|
.catch { log.warn(it) { "Failed to update chapter bookmark for chapter ${chapter.index} of ${chapter.mangaId}" } }
|
||||||
.collect()
|
.collect()
|
||||||
@@ -42,30 +42,30 @@ class UpdateChapterBookmarked @Inject constructor(private val chapterRepository:
|
|||||||
fun asFlow(
|
fun asFlow(
|
||||||
mangaId: Long,
|
mangaId: Long,
|
||||||
index: Int,
|
index: Int,
|
||||||
bookmarked: Boolean,
|
bookmarked: Boolean
|
||||||
) = chapterRepository.updateChapterBookmarked(
|
) = chapterRepository.updateChapterBookmarked(
|
||||||
mangaId = mangaId,
|
mangaId = mangaId,
|
||||||
chapterIndex = index,
|
chapterIndex = index,
|
||||||
bookmarked = bookmarked,
|
bookmarked = bookmarked
|
||||||
)
|
)
|
||||||
|
|
||||||
fun asFlow(
|
fun asFlow(
|
||||||
manga: Manga,
|
manga: Manga,
|
||||||
index: Int,
|
index: Int,
|
||||||
bookmarked: Boolean,
|
bookmarked: Boolean
|
||||||
) = chapterRepository.updateChapterBookmarked(
|
) = chapterRepository.updateChapterBookmarked(
|
||||||
mangaId = manga.id,
|
mangaId = manga.id,
|
||||||
chapterIndex = index,
|
chapterIndex = index,
|
||||||
bookmarked = bookmarked,
|
bookmarked = bookmarked
|
||||||
)
|
)
|
||||||
|
|
||||||
fun asFlow(
|
fun asFlow(
|
||||||
chapter: Chapter,
|
chapter: Chapter,
|
||||||
bookmarked: Boolean,
|
bookmarked: Boolean
|
||||||
) = chapterRepository.updateChapterBookmarked(
|
) = chapterRepository.updateChapterBookmarked(
|
||||||
mangaId = chapter.mangaId,
|
mangaId = chapter.mangaId,
|
||||||
chapterIndex = chapter.index,
|
chapterIndex = chapter.index,
|
||||||
bookmarked = bookmarked,
|
bookmarked = bookmarked
|
||||||
)
|
)
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class UpdateChapterLastPageRead @Inject constructor(private val chapterRepositor
|
|||||||
suspend fun await(
|
suspend fun await(
|
||||||
mangaId: Long,
|
mangaId: Long,
|
||||||
index: Int,
|
index: Int,
|
||||||
lastPageRead: Int,
|
lastPageRead: Int
|
||||||
) = asFlow(mangaId, index, lastPageRead)
|
) = asFlow(mangaId, index, lastPageRead)
|
||||||
.catch { log.warn(it) { "Failed to update chapter last page read for chapter $index of $mangaId" } }
|
.catch { log.warn(it) { "Failed to update chapter last page read for chapter $index of $mangaId" } }
|
||||||
.collect()
|
.collect()
|
||||||
@@ -27,14 +27,14 @@ class UpdateChapterLastPageRead @Inject constructor(private val chapterRepositor
|
|||||||
suspend fun await(
|
suspend fun await(
|
||||||
manga: Manga,
|
manga: Manga,
|
||||||
index: Int,
|
index: Int,
|
||||||
lastPageRead: Int,
|
lastPageRead: Int
|
||||||
) = asFlow(manga, index, lastPageRead)
|
) = asFlow(manga, index, lastPageRead)
|
||||||
.catch { log.warn(it) { "Failed to update chapter last page read for chapter $index of ${manga.title}(${manga.id})" } }
|
.catch { log.warn(it) { "Failed to update chapter last page read for chapter $index of ${manga.title}(${manga.id})" } }
|
||||||
.collect()
|
.collect()
|
||||||
|
|
||||||
suspend fun await(
|
suspend fun await(
|
||||||
chapter: Chapter,
|
chapter: Chapter,
|
||||||
lastPageRead: Int,
|
lastPageRead: Int
|
||||||
) = asFlow(chapter, lastPageRead)
|
) = asFlow(chapter, lastPageRead)
|
||||||
.catch { log.warn(it) { "Failed to update chapter last page read for chapter ${chapter.index} of ${chapter.mangaId}" } }
|
.catch { log.warn(it) { "Failed to update chapter last page read for chapter ${chapter.index} of ${chapter.mangaId}" } }
|
||||||
.collect()
|
.collect()
|
||||||
@@ -42,30 +42,30 @@ class UpdateChapterLastPageRead @Inject constructor(private val chapterRepositor
|
|||||||
fun asFlow(
|
fun asFlow(
|
||||||
mangaId: Long,
|
mangaId: Long,
|
||||||
index: Int,
|
index: Int,
|
||||||
lastPageRead: Int,
|
lastPageRead: Int
|
||||||
) = chapterRepository.updateChapterLastPageRead(
|
) = chapterRepository.updateChapterLastPageRead(
|
||||||
mangaId = mangaId,
|
mangaId = mangaId,
|
||||||
chapterIndex = index,
|
chapterIndex = index,
|
||||||
lastPageRead = lastPageRead,
|
lastPageRead = lastPageRead
|
||||||
)
|
)
|
||||||
|
|
||||||
fun asFlow(
|
fun asFlow(
|
||||||
manga: Manga,
|
manga: Manga,
|
||||||
index: Int,
|
index: Int,
|
||||||
lastPageRead: Int,
|
lastPageRead: Int
|
||||||
) = chapterRepository.updateChapterLastPageRead(
|
) = chapterRepository.updateChapterLastPageRead(
|
||||||
mangaId = manga.id,
|
mangaId = manga.id,
|
||||||
chapterIndex = index,
|
chapterIndex = index,
|
||||||
lastPageRead = lastPageRead,
|
lastPageRead = lastPageRead
|
||||||
)
|
)
|
||||||
|
|
||||||
fun asFlow(
|
fun asFlow(
|
||||||
chapter: Chapter,
|
chapter: Chapter,
|
||||||
lastPageRead: Int,
|
lastPageRead: Int
|
||||||
) = chapterRepository.updateChapterLastPageRead(
|
) = chapterRepository.updateChapterLastPageRead(
|
||||||
mangaId = chapter.mangaId,
|
mangaId = chapter.mangaId,
|
||||||
chapterIndex = chapter.index,
|
chapterIndex = chapter.index,
|
||||||
lastPageRead = lastPageRead,
|
lastPageRead = lastPageRead
|
||||||
)
|
)
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class UpdateChapterMarkPreviousRead @Inject constructor(private val chapterRepos
|
|||||||
|
|
||||||
fun asFlow(
|
fun asFlow(
|
||||||
mangaId: Long,
|
mangaId: Long,
|
||||||
index: Int,
|
index: Int
|
||||||
) = chapterRepository.updateChapterMarkPrevRead(
|
) = chapterRepository.updateChapterMarkPrevRead(
|
||||||
mangaId = mangaId,
|
mangaId = mangaId,
|
||||||
chapterIndex = index
|
chapterIndex = index
|
||||||
@@ -46,17 +46,17 @@ class UpdateChapterMarkPreviousRead @Inject constructor(private val chapterRepos
|
|||||||
|
|
||||||
fun asFlow(
|
fun asFlow(
|
||||||
manga: Manga,
|
manga: Manga,
|
||||||
index: Int,
|
index: Int
|
||||||
) = chapterRepository.updateChapterMarkPrevRead(
|
) = chapterRepository.updateChapterMarkPrevRead(
|
||||||
mangaId = manga.id,
|
mangaId = manga.id,
|
||||||
chapterIndex = index,
|
chapterIndex = index
|
||||||
)
|
)
|
||||||
|
|
||||||
fun asFlow(
|
fun asFlow(
|
||||||
chapter: Chapter,
|
chapter: Chapter
|
||||||
) = chapterRepository.updateChapterMarkPrevRead(
|
) = chapterRepository.updateChapterMarkPrevRead(
|
||||||
mangaId = chapter.mangaId,
|
mangaId = chapter.mangaId,
|
||||||
chapterIndex = chapter.index,
|
chapterIndex = chapter.index
|
||||||
)
|
)
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class UpdateChapterRead @Inject constructor(private val chapterRepository: Chapt
|
|||||||
suspend fun await(
|
suspend fun await(
|
||||||
mangaId: Long,
|
mangaId: Long,
|
||||||
index: Int,
|
index: Int,
|
||||||
read: Boolean,
|
read: Boolean
|
||||||
) = asFlow(mangaId, index, read)
|
) = asFlow(mangaId, index, read)
|
||||||
.catch { log.warn(it) { "Failed to update chapter read status for chapter $index of $mangaId" } }
|
.catch { log.warn(it) { "Failed to update chapter read status for chapter $index of $mangaId" } }
|
||||||
.collect()
|
.collect()
|
||||||
@@ -27,14 +27,14 @@ class UpdateChapterRead @Inject constructor(private val chapterRepository: Chapt
|
|||||||
suspend fun await(
|
suspend fun await(
|
||||||
manga: Manga,
|
manga: Manga,
|
||||||
index: Int,
|
index: Int,
|
||||||
read: Boolean,
|
read: Boolean
|
||||||
) = asFlow(manga, index, read)
|
) = asFlow(manga, index, read)
|
||||||
.catch { log.warn(it) { "Failed to update chapter read status for chapter $index of ${manga.title}(${manga.id})" } }
|
.catch { log.warn(it) { "Failed to update chapter read status for chapter $index of ${manga.title}(${manga.id})" } }
|
||||||
.collect()
|
.collect()
|
||||||
|
|
||||||
suspend fun await(
|
suspend fun await(
|
||||||
chapter: Chapter,
|
chapter: Chapter,
|
||||||
read: Boolean,
|
read: Boolean
|
||||||
) = asFlow(chapter, read)
|
) = asFlow(chapter, read)
|
||||||
.catch { log.warn(it) { "Failed to update chapter read status for chapter ${chapter.index} of ${chapter.mangaId}" } }
|
.catch { log.warn(it) { "Failed to update chapter read status for chapter ${chapter.index} of ${chapter.mangaId}" } }
|
||||||
.collect()
|
.collect()
|
||||||
@@ -42,30 +42,30 @@ class UpdateChapterRead @Inject constructor(private val chapterRepository: Chapt
|
|||||||
fun asFlow(
|
fun asFlow(
|
||||||
mangaId: Long,
|
mangaId: Long,
|
||||||
index: Int,
|
index: Int,
|
||||||
read: Boolean,
|
read: Boolean
|
||||||
) = chapterRepository.updateChapterRead(
|
) = chapterRepository.updateChapterRead(
|
||||||
mangaId = mangaId,
|
mangaId = mangaId,
|
||||||
chapterIndex = index,
|
chapterIndex = index,
|
||||||
read = read,
|
read = read
|
||||||
)
|
)
|
||||||
|
|
||||||
fun asFlow(
|
fun asFlow(
|
||||||
manga: Manga,
|
manga: Manga,
|
||||||
index: Int,
|
index: Int,
|
||||||
read: Boolean,
|
read: Boolean
|
||||||
) = chapterRepository.updateChapterRead(
|
) = chapterRepository.updateChapterRead(
|
||||||
mangaId = manga.id,
|
mangaId = manga.id,
|
||||||
chapterIndex = index,
|
chapterIndex = index,
|
||||||
read = read,
|
read = read
|
||||||
)
|
)
|
||||||
|
|
||||||
fun asFlow(
|
fun asFlow(
|
||||||
chapter: Chapter,
|
chapter: Chapter,
|
||||||
read: Boolean,
|
read: Boolean
|
||||||
) = chapterRepository.updateChapterRead(
|
) = chapterRepository.updateChapterRead(
|
||||||
mangaId = chapter.mangaId,
|
mangaId = chapter.mangaId,
|
||||||
chapterIndex = chapter.index,
|
chapterIndex = chapter.index,
|
||||||
read = read,
|
read = read
|
||||||
)
|
)
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ interface ChapterRepository {
|
|||||||
fun updateChapterRead(
|
fun updateChapterRead(
|
||||||
@Path("mangaId") mangaId: Long,
|
@Path("mangaId") mangaId: Long,
|
||||||
@Path("chapterIndex") chapterIndex: Int,
|
@Path("chapterIndex") chapterIndex: Int,
|
||||||
@Field("read") read: Boolean,
|
@Field("read") read: Boolean
|
||||||
): Flow<HttpResponse>
|
): Flow<HttpResponse>
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@@ -59,7 +59,7 @@ interface ChapterRepository {
|
|||||||
fun updateChapterBookmarked(
|
fun updateChapterBookmarked(
|
||||||
@Path("mangaId") mangaId: Long,
|
@Path("mangaId") mangaId: Long,
|
||||||
@Path("chapterIndex") chapterIndex: Int,
|
@Path("chapterIndex") chapterIndex: Int,
|
||||||
@Field("bookmarked") bookmarked: Boolean,
|
@Field("bookmarked") bookmarked: Boolean
|
||||||
): Flow<HttpResponse>
|
): Flow<HttpResponse>
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@@ -67,7 +67,7 @@ interface ChapterRepository {
|
|||||||
fun updateChapterLastPageRead(
|
fun updateChapterLastPageRead(
|
||||||
@Path("mangaId") mangaId: Long,
|
@Path("mangaId") mangaId: Long,
|
||||||
@Path("chapterIndex") chapterIndex: Int,
|
@Path("chapterIndex") chapterIndex: Int,
|
||||||
@Field("lastPageRead") lastPageRead: Int,
|
@Field("lastPageRead") lastPageRead: Int
|
||||||
): Flow<HttpResponse>
|
): Flow<HttpResponse>
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
|
|||||||
Reference in New Issue
Block a user