From 63d1a3e3fb1e4e36044a2187ae2b972963c423fa Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Wed, 21 Jan 2026 20:47:02 +0800 Subject: [PATCH] ktlint: Fix no-empty-first-line-in-method-block violations Signed-off-by: Aayush Gupta --- .editorconfig | 1 - .../schabi/newpipe/local/history/HistoryRecordManagerTest.kt | 1 - .../java/org/schabi/newpipe/database/stream/dao/StreamDAO.kt | 1 - app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt | 1 - .../java/org/schabi/newpipe/local/playlist/ExportPlaylist.kt | 2 -- .../java/org/schabi/newpipe/util/potoken/PoTokenProviderImpl.kt | 1 - 6 files changed, 7 deletions(-) diff --git a/.editorconfig b/.editorconfig index 62ebdafe2..ffd02caf2 100644 --- a/.editorconfig +++ b/.editorconfig @@ -19,6 +19,5 @@ ktlint_standard_function-signature = disabled ktlint_standard_max-line-length = disabled ktlint_standard_mixed-condition-operators = disabled ktlint_standard_no-empty-first-line-in-class-body = disabled -ktlint_standard_no-empty-first-line-in-method-block = disabled ktlint_standard_package-name = disabled ktlint_standard_property-naming = disabled diff --git a/app/src/androidTest/java/org/schabi/newpipe/local/history/HistoryRecordManagerTest.kt b/app/src/androidTest/java/org/schabi/newpipe/local/history/HistoryRecordManagerTest.kt index 06c0fd09c..32fb08db0 100644 --- a/app/src/androidTest/java/org/schabi/newpipe/local/history/HistoryRecordManagerTest.kt +++ b/app/src/androidTest/java/org/schabi/newpipe/local/history/HistoryRecordManagerTest.kt @@ -98,7 +98,6 @@ class HistoryRecordManagerTest { } private fun insertShuffledRelatedSearches(relatedSearches: Collection) { - // shuffle to make sure the order of items returned by queries depends only on // SearchHistoryEntry.creationDate, not on the actual insertion time, so that we can // verify that the `ORDER BY` clause does its job diff --git a/app/src/main/java/org/schabi/newpipe/database/stream/dao/StreamDAO.kt b/app/src/main/java/org/schabi/newpipe/database/stream/dao/StreamDAO.kt index 6ef64ec4d..a6ab2c6cc 100644 --- a/app/src/main/java/org/schabi/newpipe/database/stream/dao/StreamDAO.kt +++ b/app/src/main/java/org/schabi/newpipe/database/stream/dao/StreamDAO.kt @@ -91,7 +91,6 @@ abstract class StreamDAO : BasicDAO { newerStream.uid = existentMinimalStream.uid if (!StreamTypeUtil.isLiveStream(newerStream.streamType)) { - // Use the existent upload date if the newer stream does not have a better precision // (i.e. is an approximation). This is done to prevent unnecessary changes. val hasBetterPrecision = diff --git a/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt b/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt index 930998c67..ac076f1b8 100644 --- a/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt +++ b/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt @@ -152,7 +152,6 @@ class FeedFragment : BaseStateFragment() { if (newState == RecyclerView.SCROLL_STATE_IDLE && !recyclerView.canScrollVertically(-1) ) { - if (tryGetNewItemsLoadedButton()?.isVisible == true) { hideNewItemsLoaded(true) } diff --git a/app/src/main/java/org/schabi/newpipe/local/playlist/ExportPlaylist.kt b/app/src/main/java/org/schabi/newpipe/local/playlist/ExportPlaylist.kt index 2e23d745d..ede5ce819 100644 --- a/app/src/main/java/org/schabi/newpipe/local/playlist/ExportPlaylist.kt +++ b/app/src/main/java/org/schabi/newpipe/local/playlist/ExportPlaylist.kt @@ -44,7 +44,6 @@ private fun exportJustUrls(playlist: List): String { } private fun exportAsYoutubeTempPlaylist(playlist: List): String { - val videoIDs = playlist.asReversed().asSequence() .mapNotNull { getYouTubeId(it.streamEntity.url) } .take(50) // YouTube limitation: temp playlists can't have more than 50 items @@ -64,7 +63,6 @@ private val linkHandler: YoutubeStreamLinkHandlerFactory = YoutubeStreamLinkHand * @return the video id */ private fun getYouTubeId(url: String): String? { - return try { linkHandler.getId(url) } catch (e: ParsingException) { diff --git a/app/src/main/java/org/schabi/newpipe/util/potoken/PoTokenProviderImpl.kt b/app/src/main/java/org/schabi/newpipe/util/potoken/PoTokenProviderImpl.kt index eb1153c7f..12fadb68d 100644 --- a/app/src/main/java/org/schabi/newpipe/util/potoken/PoTokenProviderImpl.kt +++ b/app/src/main/java/org/schabi/newpipe/util/potoken/PoTokenProviderImpl.kt @@ -60,7 +60,6 @@ object PoTokenProviderImpl : PoTokenProvider { webPoTokenGenerator!!.isExpired() if (shouldRecreate) { - val innertubeClientRequestInfo = InnertubeClientRequestInfo.ofWebClient() innertubeClientRequestInfo.clientInfo.clientVersion = YoutubeParsingHelper.getClientVersion()