Automatic Lint

This commit is contained in:
Syer10
2022-09-25 23:15:07 +00:00
parent 92e70bf621
commit 12c4bfdfa4
8 changed files with 39 additions and 40 deletions

View File

@@ -18,7 +18,6 @@ fun String.chop(count: Int, replacement: String = "…"): String {
}
}
fun String.addSuffix(char: Char): String {
return if (endsWith(char)) {
this

View File

@@ -19,7 +19,7 @@ class UpdateChapterBookmarked @Inject constructor(private val chapterRepository:
suspend fun await(
mangaId: Long,
index: Int,
bookmarked: Boolean,
bookmarked: Boolean
) = asFlow(mangaId, index, bookmarked)
.catch { log.warn(it) { "Failed to update chapter bookmark for chapter $index of $mangaId" } }
.collect()
@@ -27,14 +27,14 @@ class UpdateChapterBookmarked @Inject constructor(private val chapterRepository:
suspend fun await(
manga: Manga,
index: Int,
bookmarked: Boolean,
bookmarked: Boolean
) = asFlow(manga, index, bookmarked)
.catch { log.warn(it) { "Failed to update chapter bookmark for chapter $index of ${manga.title}(${manga.id})" } }
.collect()
suspend fun await(
chapter: Chapter,
bookmarked: Boolean,
bookmarked: Boolean
) = asFlow(chapter, bookmarked)
.catch { log.warn(it) { "Failed to update chapter bookmark for chapter ${chapter.index} of ${chapter.mangaId}" } }
.collect()
@@ -42,30 +42,30 @@ class UpdateChapterBookmarked @Inject constructor(private val chapterRepository:
fun asFlow(
mangaId: Long,
index: Int,
bookmarked: Boolean,
bookmarked: Boolean
) = chapterRepository.updateChapterBookmarked(
mangaId = mangaId,
chapterIndex = index,
bookmarked = bookmarked,
bookmarked = bookmarked
)
fun asFlow(
manga: Manga,
index: Int,
bookmarked: Boolean,
bookmarked: Boolean
) = chapterRepository.updateChapterBookmarked(
mangaId = manga.id,
chapterIndex = index,
bookmarked = bookmarked,
bookmarked = bookmarked
)
fun asFlow(
chapter: Chapter,
bookmarked: Boolean,
bookmarked: Boolean
) = chapterRepository.updateChapterBookmarked(
mangaId = chapter.mangaId,
chapterIndex = chapter.index,
bookmarked = bookmarked,
bookmarked = bookmarked
)
companion object {

View File

@@ -19,7 +19,7 @@ class UpdateChapterLastPageRead @Inject constructor(private val chapterRepositor
suspend fun await(
mangaId: Long,
index: Int,
lastPageRead: Int,
lastPageRead: Int
) = asFlow(mangaId, index, lastPageRead)
.catch { log.warn(it) { "Failed to update chapter last page read for chapter $index of $mangaId" } }
.collect()
@@ -27,14 +27,14 @@ class UpdateChapterLastPageRead @Inject constructor(private val chapterRepositor
suspend fun await(
manga: Manga,
index: Int,
lastPageRead: Int,
lastPageRead: Int
) = asFlow(manga, index, lastPageRead)
.catch { log.warn(it) { "Failed to update chapter last page read for chapter $index of ${manga.title}(${manga.id})" } }
.collect()
suspend fun await(
chapter: Chapter,
lastPageRead: Int,
lastPageRead: Int
) = asFlow(chapter, lastPageRead)
.catch { log.warn(it) { "Failed to update chapter last page read for chapter ${chapter.index} of ${chapter.mangaId}" } }
.collect()
@@ -42,30 +42,30 @@ class UpdateChapterLastPageRead @Inject constructor(private val chapterRepositor
fun asFlow(
mangaId: Long,
index: Int,
lastPageRead: Int,
lastPageRead: Int
) = chapterRepository.updateChapterLastPageRead(
mangaId = mangaId,
chapterIndex = index,
lastPageRead = lastPageRead,
lastPageRead = lastPageRead
)
fun asFlow(
manga: Manga,
index: Int,
lastPageRead: Int,
lastPageRead: Int
) = chapterRepository.updateChapterLastPageRead(
mangaId = manga.id,
chapterIndex = index,
lastPageRead = lastPageRead,
lastPageRead = lastPageRead
)
fun asFlow(
chapter: Chapter,
lastPageRead: Int,
lastPageRead: Int
) = chapterRepository.updateChapterLastPageRead(
mangaId = chapter.mangaId,
chapterIndex = chapter.index,
lastPageRead = lastPageRead,
lastPageRead = lastPageRead
)
companion object {

View File

@@ -38,7 +38,7 @@ class UpdateChapterMarkPreviousRead @Inject constructor(private val chapterRepos
fun asFlow(
mangaId: Long,
index: Int,
index: Int
) = chapterRepository.updateChapterMarkPrevRead(
mangaId = mangaId,
chapterIndex = index
@@ -46,17 +46,17 @@ class UpdateChapterMarkPreviousRead @Inject constructor(private val chapterRepos
fun asFlow(
manga: Manga,
index: Int,
index: Int
) = chapterRepository.updateChapterMarkPrevRead(
mangaId = manga.id,
chapterIndex = index,
chapterIndex = index
)
fun asFlow(
chapter: Chapter,
chapter: Chapter
) = chapterRepository.updateChapterMarkPrevRead(
mangaId = chapter.mangaId,
chapterIndex = chapter.index,
chapterIndex = chapter.index
)
companion object {

View File

@@ -19,7 +19,7 @@ class UpdateChapterRead @Inject constructor(private val chapterRepository: Chapt
suspend fun await(
mangaId: Long,
index: Int,
read: Boolean,
read: Boolean
) = asFlow(mangaId, index, read)
.catch { log.warn(it) { "Failed to update chapter read status for chapter $index of $mangaId" } }
.collect()
@@ -27,14 +27,14 @@ class UpdateChapterRead @Inject constructor(private val chapterRepository: Chapt
suspend fun await(
manga: Manga,
index: Int,
read: Boolean,
read: Boolean
) = asFlow(manga, index, read)
.catch { log.warn(it) { "Failed to update chapter read status for chapter $index of ${manga.title}(${manga.id})" } }
.collect()
suspend fun await(
chapter: Chapter,
read: Boolean,
read: Boolean
) = asFlow(chapter, read)
.catch { log.warn(it) { "Failed to update chapter read status for chapter ${chapter.index} of ${chapter.mangaId}" } }
.collect()
@@ -42,30 +42,30 @@ class UpdateChapterRead @Inject constructor(private val chapterRepository: Chapt
fun asFlow(
mangaId: Long,
index: Int,
read: Boolean,
read: Boolean
) = chapterRepository.updateChapterRead(
mangaId = mangaId,
chapterIndex = index,
read = read,
read = read
)
fun asFlow(
manga: Manga,
index: Int,
read: Boolean,
read: Boolean
) = chapterRepository.updateChapterRead(
mangaId = manga.id,
chapterIndex = index,
read = read,
read = read
)
fun asFlow(
chapter: Chapter,
read: Boolean,
read: Boolean
) = chapterRepository.updateChapterRead(
mangaId = chapter.mangaId,
chapterIndex = chapter.index,
read = read,
read = read
)
companion object {

View File

@@ -45,13 +45,13 @@ interface ChapterRepository {
@Field("markPrevRead") markPreviousRead: Boolean? = null
): Flow<HttpResponse>*/
//todo remove following updateChapter functions once ktorfit supports nullable parameters
// todo remove following updateChapter functions once ktorfit supports nullable parameters
@FormUrlEncoded
@PATCH("api/v1/manga/{mangaId}/chapter/{chapterIndex}")
fun updateChapterRead(
@Path("mangaId") mangaId: Long,
@Path("chapterIndex") chapterIndex: Int,
@Field("read") read: Boolean,
@Field("read") read: Boolean
): Flow<HttpResponse>
@FormUrlEncoded
@@ -59,7 +59,7 @@ interface ChapterRepository {
fun updateChapterBookmarked(
@Path("mangaId") mangaId: Long,
@Path("chapterIndex") chapterIndex: Int,
@Field("bookmarked") bookmarked: Boolean,
@Field("bookmarked") bookmarked: Boolean
): Flow<HttpResponse>
@FormUrlEncoded
@@ -67,7 +67,7 @@ interface ChapterRepository {
fun updateChapterLastPageRead(
@Path("mangaId") mangaId: Long,
@Path("chapterIndex") chapterIndex: Int,
@Field("lastPageRead") lastPageRead: Int,
@Field("lastPageRead") lastPageRead: Int
): Flow<HttpResponse>
@FormUrlEncoded