Implement Mihon's spotless PR (#1257)

* Remove detekt (mihonapp/mihon#1130)

Annoying. More annoying in this project.

(cherry picked from commit 777ae2461e1eb277a3aa0c998ff69e4f100387a1)

* Add spotless (with ktlint) (mihonapp/mihon#1136)

(cherry picked from commit 5ae8095ef1ed2ae9f98486f9148e933c77a28692)

* Address spotless lint errors (mihonapp/mihon#1138)

* Add spotless (with ktlint)

* Run spotlessApply

* screaming case screaming case screaming case

* Update PagerViewerAdapter.kt

* Update ReaderTransitionView.kt

(cherry picked from commit d6252ab7703d52ecf9f43de3ee36fd63e665a31f)

* Generate locales_config.xml in build dir

(cherry picked from commit ac41bffdc97b4cfed923de6b9e8e01cccf3eb6eb)

* Address more spotless lint errors in SY

* some more missed

* more missed

* still missing, not sure while it won't report error when running locally

* one more

* more

* more

* correct comment

---------

Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
This commit is contained in:
Tran M. Cuong
2024-08-23 08:24:50 +07:00
committed by GitHub
parent 759fd4d4e3
commit 3705880a77
363 changed files with 1223 additions and 3138 deletions
+1 -1
View File
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest />
<manifest />
@@ -48,7 +48,6 @@ class CreateExtensionRepo(
*
* @param repo Extension Repo holder for passing to DB/Error Dialog
*/
@Suppress("ReturnCount")
private suspend fun handleInsertionError(repo: ExtensionRepo): Result {
val repoExists = repository.getRepo(repo.baseUrl)
if (repoExists != null) {
@@ -17,7 +17,6 @@ class ExtensionRepoService(
) {
val client = networkHelper.client
@Suppress("TooGenericExceptionCaught")
suspend fun fetchRepoDetails(
repo: String,
): ExtensionRepo? {
@@ -112,7 +112,8 @@ class GetMergedChaptersByMangaId(
if (chapter.isRecognizedNumber) {
existingChapterIndex = sortedChapterList.indexOfFirst {
// check if the chapter is not already there
it.isRecognizedNumber && it.chapterNumber == chapter.chapterNumber &&
it.isRecognizedNumber &&
it.chapterNumber == chapter.chapterNumber &&
// allow multiple chapters of the same number from the same source
it.mangaId != chapter.mangaId
}
@@ -5,7 +5,8 @@ import tachiyomi.domain.chapter.model.Chapter
class ShouldUpdateDbChapter {
fun await(dbChapter: Chapter, sourceChapter: Chapter): Boolean {
return dbChapter.scanlator != sourceChapter.scanlator || dbChapter.name != sourceChapter.name ||
return dbChapter.scanlator != sourceChapter.scanlator ||
dbChapter.name != sourceChapter.name ||
dbChapter.dateUpload != sourceChapter.dateUpload ||
dbChapter.chapterNumber != sourceChapter.chapterNumber ||
dbChapter.sourceOrder != sourceChapter.sourceOrder
@@ -20,10 +20,8 @@ class GetApplicationRelease(
val now = Instant.now()
// Limit checks to once every 3 days at most
if (!arguments.forceCheck && now.isBefore(
Instant.ofEpochMilli(lastChecked.get()).plus(3, ChronoUnit.DAYS),
)
) {
val nextCheckTime = Instant.ofEpochMilli(lastChecked.get()).plus(3, ChronoUnit.DAYS)
if (!arguments.forceCheck && now.isBefore(nextCheckTime)) {
return Result.NoNewUpdate
}
@@ -5,6 +5,8 @@ import tachiyomi.domain.track.model.Track
class IsTrackUnfollowed {
fun await(track: Track) =
track.trackerId == 60L && // TrackManager.MDLIST
track.status == 0L // FollowStatus.UNFOLLOWED
// TrackManager.MDLIST
track.trackerId == 60L &&
// FollowStatus.UNFOLLOWED
track.status == 0L
}