diff --git a/app/src/main/java/eu/kanade/domain/chapter/interactor/SyncChaptersWithSource.kt b/app/src/main/java/eu/kanade/domain/chapter/interactor/SyncChaptersWithSource.kt index abd13a8492..300794b4c1 100644 --- a/app/src/main/java/eu/kanade/domain/chapter/interactor/SyncChaptersWithSource.kt +++ b/app/src/main/java/eu/kanade/domain/chapter/interactor/SyncChaptersWithSource.kt @@ -163,7 +163,7 @@ class SyncChaptersWithSource( var updatedToAdd = newChapters.map { toAddItem -> var chapter = toAddItem.copy(dateFetch = nowMillis + itemCount--) - if (chapter.isRecognizedNumber.not() || chapter.chapterNumber !in deletedChapterNumbers) return@map chapter + if (!chapter.isRecognizedNumber || chapter.chapterNumber !in deletedChapterNumbers) return@map chapter chapter = chapter.copy( read = chapter.chapterNumber in deletedReadChapterNumbers, diff --git a/app/src/main/java/eu/kanade/domain/extension/interactor/GetExtensionSources.kt b/app/src/main/java/eu/kanade/domain/extension/interactor/GetExtensionSources.kt index 280dfae04a..7c7a6a9199 100644 --- a/app/src/main/java/eu/kanade/domain/extension/interactor/GetExtensionSources.kt +++ b/app/src/main/java/eu/kanade/domain/extension/interactor/GetExtensionSources.kt @@ -23,7 +23,7 @@ class GetExtensionSources( ExtensionSourceItem( source = source, enabled = source.isEnabled(), - labelAsName = isMultiSource && isMultiLangSingleSource.not(), + labelAsName = isMultiSource && !isMultiLangSingleSource, ) } } diff --git a/app/src/main/java/eu/kanade/domain/extension/interactor/GetExtensionsByType.kt b/app/src/main/java/eu/kanade/domain/extension/interactor/GetExtensionsByType.kt index 4156a27c5f..dadbd35f67 100644 --- a/app/src/main/java/eu/kanade/domain/extension/interactor/GetExtensionsByType.kt +++ b/app/src/main/java/eu/kanade/domain/extension/interactor/GetExtensionsByType.kt @@ -22,9 +22,9 @@ class GetExtensionsByType( extensionManager.availableExtensionsFlow, ) { _activeLanguages, _installed, _untrusted, _available -> val (updates, installed) = _installed - .filter { (showNsfwSources || it.isNsfw.not()) } + .filter { (showNsfwSources || !it.isNsfw) } .sortedWith( - compareBy { it.isObsolete.not() } + compareBy { !it.isObsolete } .thenBy(String.CASE_INSENSITIVE_ORDER) { it.name }, ) .partition { it.hasUpdate } @@ -36,7 +36,7 @@ class GetExtensionsByType( .filter { extension -> _installed.none { it.pkgName == extension.pkgName } && _untrusted.none { it.pkgName == extension.pkgName } && - (showNsfwSources || extension.isNsfw.not()) + (showNsfwSources || !extension.isNsfw) } .flatMap { ext -> if (ext.sources.isEmpty()) { diff --git a/app/src/main/java/eu/kanade/domain/source/interactor/GetSourcesWithFavoriteCount.kt b/app/src/main/java/eu/kanade/domain/source/interactor/GetSourcesWithFavoriteCount.kt index c37be75aad..0cf342cafb 100644 --- a/app/src/main/java/eu/kanade/domain/source/interactor/GetSourcesWithFavoriteCount.kt +++ b/app/src/main/java/eu/kanade/domain/source/interactor/GetSourcesWithFavoriteCount.kt @@ -34,15 +34,15 @@ class GetSourcesWithFavoriteCount( when (sorting) { SetMigrateSorting.Mode.ALPHABETICAL -> { when { - a.first.isStub && b.first.isStub.not() -> -1 - b.first.isStub && a.first.isStub.not() -> 1 + a.first.isStub && !b.first.isStub -> -1 + b.first.isStub && !a.first.isStub -> 1 else -> a.first.name.lowercase().compareToWithCollator(b.first.name.lowercase()) } } SetMigrateSorting.Mode.TOTAL -> { when { - a.first.isStub && b.first.isStub.not() -> -1 - b.first.isStub && a.first.isStub.not() -> 1 + a.first.isStub && !b.first.isStub -> -1 + b.first.isStub && !a.first.isStub -> 1 else -> a.second.compareTo(b.second) } } diff --git a/app/src/main/java/eu/kanade/domain/track/model/Track.kt b/app/src/main/java/eu/kanade/domain/track/model/Track.kt index 332ddd8d51..3ce611bab3 100644 --- a/app/src/main/java/eu/kanade/domain/track/model/Track.kt +++ b/app/src/main/java/eu/kanade/domain/track/model/Track.kt @@ -29,7 +29,7 @@ fun Track.toDbTrack(): DbTrack = DbTrack.create(trackerId).also { } fun DbTrack.toDomainTrack(idRequired: Boolean = true): Track? { - val trackId = id ?: if (idRequired.not()) -1 else return null + val trackId = id ?: if (!idRequired) -1 else return null return Track( id = trackId, mangaId = manga_id, diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt index 3e447f4abb..61d0be98eb 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt @@ -315,13 +315,13 @@ class DownloadManager( val capitalizationChanged = oldFolder.name.equals(newName, ignoreCase = true) if (capitalizationChanged) { val tempName = newName + Downloader.TMP_DIR_SUFFIX - if (oldFolder.renameTo(tempName).not()) { + if (!oldFolder.renameTo(tempName)) { logcat(LogPriority.ERROR) { "Failed to rename source download folder: ${oldFolder.name}" } return } } - if (oldFolder.renameTo(newName).not()) { + if (!oldFolder.renameTo(newName)) { logcat(LogPriority.ERROR) { "Failed to rename source download folder: ${oldFolder.name}" } } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadProvider.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadProvider.kt index f6d8e064b2..469cc0765a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadProvider.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadProvider.kt @@ -130,7 +130,7 @@ class DownloadProvider( val newChapterName = sanitizeChapterName(chapterName) return DiskUtil.buildValidFilename( when { - chapterScanlator.isNullOrBlank().not() -> "${chapterScanlator}_$newChapterName" + !chapterScanlator.isNullOrBlank() -> "${chapterScanlator}_$newChapterName" else -> newChapterName }, ) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/Anilist.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/Anilist.kt index 93fd75a452..dc799dfe11 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/Anilist.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/Anilist.kt @@ -185,7 +185,7 @@ class Anilist(id: Long) : BaseTracker(id, "AniList"), DeletableTracker { if (track.status != COMPLETED) { val isRereading = track.status == REREADING - track.status = if (isRereading.not() && hasReadChapters) READING else track.status + track.status = if (!isRereading && hasReadChapters) READING else track.status } update(track) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeList.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeList.kt index 5d66b73d46..5f75b12e82 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeList.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeList.kt @@ -104,7 +104,7 @@ class MyAnimeList(id: Long) : BaseTracker(id, "MyAnimeList"), DeletableTracker { if (track.status != COMPLETED) { val isRereading = track.status == REREADING - track.status = if (isRereading.not() && hasReadChapters) READING else track.status + track.status = if (!isRereading && hasReadChapters) READING else track.status } update(track) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/Shikimori.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/Shikimori.kt index 8f70e03dd2..3036cc8a8d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/Shikimori.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/Shikimori.kt @@ -72,7 +72,7 @@ class Shikimori(id: Long) : BaseTracker(id, "Shikimori"), DeletableTracker { if (track.status != COMPLETED) { val isRereading = track.status == REREADING - track.status = if (isRereading.not() && hasReadChapters) READING else track.status + track.status = if (!isRereading && hasReadChapters) READING else track.status } update(track) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewer.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewer.kt index 93ea9495be..5508d1acd6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewer.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewer.kt @@ -90,7 +90,7 @@ abstract class PagerViewer(val activity: ReaderActivity) : Viewer { pager.addOnPageChangeListener( object : ViewPager.SimpleOnPageChangeListener() { override fun onPageSelected(position: Int) { - if (activity.isScrollingThroughPages.not()) { + if (!activity.isScrollingThroughPages) { activity.hideMenu() } onPageChange(position) diff --git a/core/src/main/java/eu/kanade/tachiyomi/network/interceptor/RateLimitInterceptor.kt b/core/src/main/java/eu/kanade/tachiyomi/network/interceptor/RateLimitInterceptor.kt index c4727f8a9b..eab5ec302a 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/network/interceptor/RateLimitInterceptor.kt +++ b/core/src/main/java/eu/kanade/tachiyomi/network/interceptor/RateLimitInterceptor.kt @@ -89,7 +89,7 @@ internal class RateLimitInterceptor( while (requestQueue.size >= permits) { // queue is full, remove expired entries val periodStart = SystemClock.elapsedRealtime() - rateLimitMillis var hasRemovedExpired = false - while (requestQueue.isEmpty().not() && requestQueue.first <= periodStart) { + while (!requestQueue.isEmpty() && requestQueue.first <= periodStart) { requestQueue.removeFirst() hasRemovedExpired = true } diff --git a/domain/src/main/java/tachiyomi/domain/release/interactor/GetApplicationRelease.kt b/domain/src/main/java/tachiyomi/domain/release/interactor/GetApplicationRelease.kt index bf966fa12d..380da7b1ee 100644 --- a/domain/src/main/java/tachiyomi/domain/release/interactor/GetApplicationRelease.kt +++ b/domain/src/main/java/tachiyomi/domain/release/interactor/GetApplicationRelease.kt @@ -20,7 +20,7 @@ class GetApplicationRelease( val now = Instant.now() // Limit checks to once every 3 days at most - if (arguments.forceCheck.not() && now.isBefore( + if (!arguments.forceCheck && now.isBefore( Instant.ofEpochMilli(lastChecked.get()).plus(3, ChronoUnit.DAYS), ) ) { diff --git a/domain/src/main/java/tachiyomi/domain/source/model/StubSource.kt b/domain/src/main/java/tachiyomi/domain/source/model/StubSource.kt index 544326a4cc..0fee2af183 100644 --- a/domain/src/main/java/tachiyomi/domain/source/model/StubSource.kt +++ b/domain/src/main/java/tachiyomi/domain/source/model/StubSource.kt @@ -22,7 +22,7 @@ class StubSource( throw SourceNotInstalledException() override fun toString(): String = - if (isInvalid.not()) "$name (${lang.uppercase()})" else id.toString() + if (!isInvalid) "$name (${lang.uppercase()})" else id.toString() companion object { fun from(source: Source): StubSource {