From c76d14dfd4806a13158e2e63bf3ba709f1b44b21 Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Wed, 21 Jan 2026 16:48:46 +0800 Subject: [PATCH] ktlint: Drop unused trailing commas Signed-off-by: Aayush Gupta --- .editorconfig | 2 -- .../org/schabi/newpipe/database/FeedDAOTest.kt | 4 ++-- .../local/history/HistoryRecordManagerTest.kt | 12 ++++++------ .../newpipe/util/StreamItemAdapterTest.kt | 2 +- .../org/schabi/newpipe/about/AboutActivity.kt | 2 +- .../org/schabi/newpipe/database/LocalItem.kt | 2 +- .../history/model/SearchHistoryEntry.kt | 2 +- .../history/model/StreamHistoryEntry.kt | 2 +- .../database/playlist/model/PlaylistEntity.kt | 2 +- .../java/org/schabi/newpipe/error/ErrorInfo.kt | 18 +++++++++--------- .../schabi/newpipe/error/ErrorPanelHelper.kt | 2 +- .../feed/notifications/NotificationWorker.kt | 2 +- .../local/feed/service/FeedLoadManager.kt | 4 ++-- .../local/feed/service/FeedLoadState.kt | 2 +- .../local/feed/service/FeedUpdateInfo.kt | 6 +++--- .../local/subscription/SubscriptionFragment.kt | 2 +- .../subscription/item/FeedGroupCardGridItem.kt | 2 +- .../gesture/BasePlayerGestureListener.kt | 2 +- .../gesture/PopupPlayerGestureListener.kt | 2 +- .../player/mediabrowser/MediaBrowserImpl.kt | 12 ++++++------ .../MediaBrowserPlaybackPreparer.kt | 8 ++++---- .../settings/export/ImportExportManager.kt | 4 ++-- .../NotificationModeConfigFragment.kt | 2 +- .../newpipe/util/potoken/PoTokenWebView.kt | 16 ++++++++-------- .../settings/ImportAllCombinationsTest.kt | 4 ++-- 25 files changed, 58 insertions(+), 60 deletions(-) diff --git a/.editorconfig b/.editorconfig index aac610b87..897c1b288 100644 --- a/.editorconfig +++ b/.editorconfig @@ -38,5 +38,3 @@ ktlint_standard_spacing-between-declarations-with-annotations = disabled ktlint_standard_spacing-between-declarations-with-comments = disabled ktlint_standard_statement-wrapping = disabled ktlint_standard_string-template-indent = disabled -ktlint_standard_trailing-comma-on-call-site = disabled -ktlint_standard_trailing-comma-on-declaration-site = disabled diff --git a/app/src/androidTest/java/org/schabi/newpipe/database/FeedDAOTest.kt b/app/src/androidTest/java/org/schabi/newpipe/database/FeedDAOTest.kt index 80d590f24..5216273a0 100644 --- a/app/src/androidTest/java/org/schabi/newpipe/database/FeedDAOTest.kt +++ b/app/src/androidTest/java/org/schabi/newpipe/database/FeedDAOTest.kt @@ -111,7 +111,7 @@ class FeedDAOTest { SubscriptionEntity.from(ChannelInfo(serviceId, "1", "https://youtube.com/channel/1", "https://youtube.com/channel/1", "channel-1")), SubscriptionEntity.from(ChannelInfo(serviceId, "2", "https://youtube.com/channel/2", "https://youtube.com/channel/2", "channel-2")), SubscriptionEntity.from(ChannelInfo(serviceId, "3", "https://youtube.com/channel/3", "https://youtube.com/channel/3", "channel-3")), - SubscriptionEntity.from(ChannelInfo(serviceId, "4", "https://youtube.com/channel/4", "https://youtube.com/channel/4", "channel-4")), + SubscriptionEntity.from(ChannelInfo(serviceId, "4", "https://youtube.com/channel/4", "https://youtube.com/channel/4", "channel-4")) ) ) feedDAO.insertAll( @@ -122,7 +122,7 @@ class FeedDAOTest { FeedEntity(4, 2), FeedEntity(5, 2), FeedEntity(6, 3), - FeedEntity(7, 4), + FeedEntity(7, 4) ) ) } 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 c4c93d6d5..06c0fd09c 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 @@ -54,7 +54,7 @@ class HistoryRecordManagerTest { SearchHistoryEntry(creationDate = time.minusSeconds(1), serviceId = 0, search = "A"), SearchHistoryEntry(creationDate = time.minusSeconds(2), serviceId = 2, search = "A"), SearchHistoryEntry(creationDate = time.minusSeconds(3), serviceId = 1, search = "B"), - SearchHistoryEntry(creationDate = time.minusSeconds(4), serviceId = 0, search = "B"), + SearchHistoryEntry(creationDate = time.minusSeconds(4), serviceId = 0, search = "B") ) // make sure all 4 were inserted @@ -85,7 +85,7 @@ class HistoryRecordManagerTest { val entries = listOf( SearchHistoryEntry(creationDate = time.minusSeconds(1), serviceId = 1, search = "A"), SearchHistoryEntry(creationDate = time.minusSeconds(2), serviceId = 2, search = "B"), - SearchHistoryEntry(creationDate = time.minusSeconds(3), serviceId = 0, search = "C"), + SearchHistoryEntry(creationDate = time.minusSeconds(3), serviceId = 0, search = "C") ) // make sure all 3 were inserted @@ -121,7 +121,7 @@ class HistoryRecordManagerTest { RELATED_SEARCHES_ENTRIES[6].search, // A (even if in two places) RELATED_SEARCHES_ENTRIES[4].search, // B RELATED_SEARCHES_ENTRIES[5].search, // AA - RELATED_SEARCHES_ENTRIES[2].search, // BA + RELATED_SEARCHES_ENTRIES[2].search // BA ) } @@ -136,7 +136,7 @@ class HistoryRecordManagerTest { SearchHistoryEntry(creationDate = time.minusSeconds(4), serviceId = 3, search = "A"), SearchHistoryEntry(creationDate = time.minusSeconds(3), serviceId = 3, search = "A"), SearchHistoryEntry(creationDate = time.minusSeconds(2), serviceId = 0, search = "A"), - SearchHistoryEntry(creationDate = time.minusSeconds(1), serviceId = 2, search = "AA"), + SearchHistoryEntry(creationDate = time.minusSeconds(1), serviceId = 2, search = "AA") ) insertShuffledRelatedSearches(relatedSearches) @@ -153,7 +153,7 @@ class HistoryRecordManagerTest { assertThat(searches).containsExactly( RELATED_SEARCHES_ENTRIES[6].search, // A (even if in two places) RELATED_SEARCHES_ENTRIES[5].search, // AA - RELATED_SEARCHES_ENTRIES[1].search, // BA + RELATED_SEARCHES_ENTRIES[1].search // BA ) // also make sure that the string comparison is case insensitive @@ -171,7 +171,7 @@ class HistoryRecordManagerTest { SearchHistoryEntry(creationDate = time.minusSeconds(4), serviceId = 3, search = "A"), SearchHistoryEntry(creationDate = time.minusSeconds(2), serviceId = 0, search = "B"), SearchHistoryEntry(creationDate = time.minusSeconds(3), serviceId = 2, search = "AA"), - SearchHistoryEntry(creationDate = time.minusSeconds(1), serviceId = 1, search = "A"), + SearchHistoryEntry(creationDate = time.minusSeconds(1), serviceId = 1, search = "A") ) } } diff --git a/app/src/androidTest/java/org/schabi/newpipe/util/StreamItemAdapterTest.kt b/app/src/androidTest/java/org/schabi/newpipe/util/StreamItemAdapterTest.kt index 9b8ee211e..da23bdfec 100644 --- a/app/src/androidTest/java/org/schabi/newpipe/util/StreamItemAdapterTest.kt +++ b/app/src/androidTest/java/org/schabi/newpipe/util/StreamItemAdapterTest.kt @@ -292,7 +292,7 @@ class StreamItemAdapterTest { Assert.assertEquals( "normal visibility (pos=[$position]) is not correct", findViewById(R.id.wo_sound_icon).visibility, - normalVisibility, + normalVisibility ) } spinner.adapter.getDropDownView(position, null, spinner).run { diff --git a/app/src/main/java/org/schabi/newpipe/about/AboutActivity.kt b/app/src/main/java/org/schabi/newpipe/about/AboutActivity.kt index 826616e59..0bed7ac60 100644 --- a/app/src/main/java/org/schabi/newpipe/about/AboutActivity.kt +++ b/app/src/main/java/org/schabi/newpipe/about/AboutActivity.kt @@ -195,7 +195,7 @@ class AboutActivity : AppCompatActivity() { SoftwareComponent( "SearchPreference", "2018", "ByteHamster", "https://github.com/ByteHamster/SearchPreference", StandardLicenses.MIT - ), + ) ) } } diff --git a/app/src/main/java/org/schabi/newpipe/database/LocalItem.kt b/app/src/main/java/org/schabi/newpipe/database/LocalItem.kt index 50529610b..944b247bf 100644 --- a/app/src/main/java/org/schabi/newpipe/database/LocalItem.kt +++ b/app/src/main/java/org/schabi/newpipe/database/LocalItem.kt @@ -14,6 +14,6 @@ interface LocalItem { PLAYLIST_REMOTE_ITEM, PLAYLIST_STREAM_ITEM, - STATISTIC_STREAM_ITEM, + STATISTIC_STREAM_ITEM } } diff --git a/app/src/main/java/org/schabi/newpipe/database/history/model/SearchHistoryEntry.kt b/app/src/main/java/org/schabi/newpipe/database/history/model/SearchHistoryEntry.kt index e6006a069..eee213453 100644 --- a/app/src/main/java/org/schabi/newpipe/database/history/model/SearchHistoryEntry.kt +++ b/app/src/main/java/org/schabi/newpipe/database/history/model/SearchHistoryEntry.kt @@ -29,7 +29,7 @@ data class SearchHistoryEntry @JvmOverloads constructor( @ColumnInfo(name = ID) @PrimaryKey(autoGenerate = true) - val id: Long = 0, + val id: Long = 0 ) { @Ignore diff --git a/app/src/main/java/org/schabi/newpipe/database/history/model/StreamHistoryEntry.kt b/app/src/main/java/org/schabi/newpipe/database/history/model/StreamHistoryEntry.kt index ece55269a..57d47d0ac 100644 --- a/app/src/main/java/org/schabi/newpipe/database/history/model/StreamHistoryEntry.kt +++ b/app/src/main/java/org/schabi/newpipe/database/history/model/StreamHistoryEntry.kt @@ -35,7 +35,7 @@ data class StreamHistoryEntry( streamEntity.serviceId, streamEntity.url, streamEntity.title, - streamEntity.streamType, + streamEntity.streamType ).apply { duration = streamEntity.duration uploaderName = streamEntity.uploader diff --git a/app/src/main/java/org/schabi/newpipe/database/playlist/model/PlaylistEntity.kt b/app/src/main/java/org/schabi/newpipe/database/playlist/model/PlaylistEntity.kt index 4ea4eb3a7..1f1862f4f 100644 --- a/app/src/main/java/org/schabi/newpipe/database/playlist/model/PlaylistEntity.kt +++ b/app/src/main/java/org/schabi/newpipe/database/playlist/model/PlaylistEntity.kt @@ -37,7 +37,7 @@ data class PlaylistEntity @JvmOverloads constructor( name = item.orderingName, isThumbnailPermanent = item.isThumbnailPermanent!!, thumbnailStreamId = item.thumbnailStreamId!!, - displayIndex = item.displayIndex!!, + displayIndex = item.displayIndex!! ) companion object { diff --git a/app/src/main/java/org/schabi/newpipe/error/ErrorInfo.kt b/app/src/main/java/org/schabi/newpipe/error/ErrorInfo.kt index 5056c00e1..2bdea13c0 100644 --- a/app/src/main/java/org/schabi/newpipe/error/ErrorInfo.kt +++ b/app/src/main/java/org/schabi/newpipe/error/ErrorInfo.kt @@ -59,7 +59,7 @@ class ErrorInfo private constructor( * If present, this resource can alternatively be opened in browser (useful if NewPipe is * badly broken). */ - val openInBrowserUrl: String?, + val openInBrowserUrl: String? ) : Parcelable { @JvmOverloads @@ -68,7 +68,7 @@ class ErrorInfo private constructor( userAction: UserAction, request: String, serviceId: Int? = null, - openInBrowserUrl: String? = null, + openInBrowserUrl: String? = null ) : this( throwableToStringList(throwable), userAction, @@ -78,7 +78,7 @@ class ErrorInfo private constructor( isReportable(throwable), isRetryable(throwable), (throwable as? ReCaptchaException)?.url, - openInBrowserUrl, + openInBrowserUrl ) @JvmOverloads @@ -87,7 +87,7 @@ class ErrorInfo private constructor( userAction: UserAction, request: String, serviceId: Int? = null, - openInBrowserUrl: String? = null, + openInBrowserUrl: String? = null ) : this( throwableListToStringList(throwables), userAction, @@ -97,7 +97,7 @@ class ErrorInfo private constructor( throwables.any(::isReportable), throwables.isEmpty() || throwables.any(::isRetryable), throwables.firstNotNullOfOrNull { it as? ReCaptchaException }?.url, - openInBrowserUrl, + openInBrowserUrl ) // constructor to manually build ErrorInfo when no throwable is available @@ -118,7 +118,7 @@ class ErrorInfo private constructor( throwable: Throwable, userAction: UserAction, request: String, - info: Info?, + info: Info? ) : this(throwable, userAction, request, info?.serviceId, info?.url) @@ -127,7 +127,7 @@ class ErrorInfo private constructor( throwables: List, userAction: UserAction, request: String, - info: Info?, + info: Info? ) : this(throwables, userAction, request, info?.serviceId, info?.url) @@ -144,7 +144,7 @@ class ErrorInfo private constructor( class ErrorMessage( @StringRes private val stringRes: Int, - private vararg val formatArgs: String, + private vararg val formatArgs: String ) : Parcelable { fun getString(context: Context): String { return if (formatArgs.isEmpty()) { @@ -174,7 +174,7 @@ class ErrorInfo private constructor( fun getMessage( throwable: Throwable?, action: UserAction?, - serviceId: Int?, + serviceId: Int? ): ErrorMessage { return when { // player exceptions diff --git a/app/src/main/java/org/schabi/newpipe/error/ErrorPanelHelper.kt b/app/src/main/java/org/schabi/newpipe/error/ErrorPanelHelper.kt index 9d503a935..023d13e9d 100644 --- a/app/src/main/java/org/schabi/newpipe/error/ErrorPanelHelper.kt +++ b/app/src/main/java/org/schabi/newpipe/error/ErrorPanelHelper.kt @@ -20,7 +20,7 @@ import org.schabi.newpipe.util.external_communication.ShareUtils class ErrorPanelHelper( private val fragment: Fragment, rootView: View, - onRetry: Runnable?, + onRetry: Runnable? ) { private val context: Context = rootView.context!! diff --git a/app/src/main/java/org/schabi/newpipe/local/feed/notifications/NotificationWorker.kt b/app/src/main/java/org/schabi/newpipe/local/feed/notifications/NotificationWorker.kt index 0f66186b8..36be86fcd 100644 --- a/app/src/main/java/org/schabi/newpipe/local/feed/notifications/NotificationWorker.kt +++ b/app/src/main/java/org/schabi/newpipe/local/feed/notifications/NotificationWorker.kt @@ -31,7 +31,7 @@ import org.schabi.newpipe.local.feed.service.FeedLoadService */ class NotificationWorker( appContext: Context, - workerParams: WorkerParameters, + workerParams: WorkerParameters ) : RxWorker(appContext, workerParams) { private val notificationHelper by lazy { diff --git a/app/src/main/java/org/schabi/newpipe/local/feed/service/FeedLoadManager.kt b/app/src/main/java/org/schabi/newpipe/local/feed/service/FeedLoadManager.kt index 0befb3af7..1da3e277b 100644 --- a/app/src/main/java/org/schabi/newpipe/local/feed/service/FeedLoadManager.kt +++ b/app/src/main/java/org/schabi/newpipe/local/feed/service/FeedLoadManager.kt @@ -60,7 +60,7 @@ class FeedLoadManager(private val context: Context) { */ fun startLoading( groupId: Long = FeedGroupEntity.GROUP_ALL_ID, - ignoreOutdatedThreshold: Boolean = false, + ignoreOutdatedThreshold: Boolean = false ): Single>> { val defaultSharedPreferences = PreferenceManager.getDefaultSharedPreferences(context) val useFeedExtractor = defaultSharedPreferences.getBoolean( @@ -234,7 +234,7 @@ class FeedLoadManager(private val context: Context) { subscriptionEntity, originalInfo!!, streams!!, - errors, + errors ) ) } catch (e: Throwable) { diff --git a/app/src/main/java/org/schabi/newpipe/local/feed/service/FeedLoadState.kt b/app/src/main/java/org/schabi/newpipe/local/feed/service/FeedLoadState.kt index 703f593ad..2aedf0925 100644 --- a/app/src/main/java/org/schabi/newpipe/local/feed/service/FeedLoadState.kt +++ b/app/src/main/java/org/schabi/newpipe/local/feed/service/FeedLoadState.kt @@ -3,5 +3,5 @@ package org.schabi.newpipe.local.feed.service data class FeedLoadState( val updateDescription: String, val maxProgress: Int, - val currentProgress: Int, + val currentProgress: Int ) diff --git a/app/src/main/java/org/schabi/newpipe/local/feed/service/FeedUpdateInfo.kt b/app/src/main/java/org/schabi/newpipe/local/feed/service/FeedUpdateInfo.kt index b44eec353..fb4a27913 100644 --- a/app/src/main/java/org/schabi/newpipe/local/feed/service/FeedUpdateInfo.kt +++ b/app/src/main/java/org/schabi/newpipe/local/feed/service/FeedUpdateInfo.kt @@ -25,13 +25,13 @@ data class FeedUpdateInfo( val description: String?, val subscriberCount: Long?, val streams: List, - val errors: List, + val errors: List ) { constructor( subscription: SubscriptionEntity, info: Info, streams: List, - errors: List, + errors: List ) : this( uid = subscription.uid, notificationMode = subscription.notificationMode, @@ -46,7 +46,7 @@ data class FeedUpdateInfo( description = (info as? ChannelInfo)?.description, subscriberCount = (info as? ChannelInfo)?.subscriberCount, streams = streams, - errors = errors, + errors = errors ) /** diff --git a/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.kt b/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.kt index 5a69c3b41..f913c845a 100644 --- a/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.kt +++ b/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.kt @@ -309,7 +309,7 @@ class SubscriptionFragment : BaseStateFragment() { title = getString(R.string.feed_groups_header_title), onSortClicked = ::openReorderDialog, onToggleListViewModeClicked = ::toggleListViewMode, - listViewMode = viewModel.getListViewMode(), + listViewMode = viewModel.getListViewMode() ) add(Section(feedGroupsSortMenuItem, listOf(feedGroupsCarousel))) diff --git a/app/src/main/java/org/schabi/newpipe/local/subscription/item/FeedGroupCardGridItem.kt b/app/src/main/java/org/schabi/newpipe/local/subscription/item/FeedGroupCardGridItem.kt index 5a9d6887b..c78801c03 100644 --- a/app/src/main/java/org/schabi/newpipe/local/subscription/item/FeedGroupCardGridItem.kt +++ b/app/src/main/java/org/schabi/newpipe/local/subscription/item/FeedGroupCardGridItem.kt @@ -10,7 +10,7 @@ import org.schabi.newpipe.local.subscription.FeedGroupIcon data class FeedGroupCardGridItem( val groupId: Long = FeedGroupEntity.GROUP_ALL_ID, val name: String, - val icon: FeedGroupIcon, + val icon: FeedGroupIcon ) : BindableItem() { constructor (feedGroupEntity: FeedGroupEntity) : this(feedGroupEntity.uid, feedGroupEntity.name, feedGroupEntity.icon) diff --git a/app/src/main/java/org/schabi/newpipe/player/gesture/BasePlayerGestureListener.kt b/app/src/main/java/org/schabi/newpipe/player/gesture/BasePlayerGestureListener.kt index 36ee5e05e..8682adc43 100644 --- a/app/src/main/java/org/schabi/newpipe/player/gesture/BasePlayerGestureListener.kt +++ b/app/src/main/java/org/schabi/newpipe/player/gesture/BasePlayerGestureListener.kt @@ -18,7 +18,7 @@ import org.schabi.newpipe.player.ui.VideoPlayerUi * and provides some abstract methods to make it easier separating the logic from the UI. */ abstract class BasePlayerGestureListener( - private val playerUi: VideoPlayerUi, + private val playerUi: VideoPlayerUi ) : GestureDetector.SimpleOnGestureListener(), View.OnTouchListener { protected val player: Player = playerUi.player diff --git a/app/src/main/java/org/schabi/newpipe/player/gesture/PopupPlayerGestureListener.kt b/app/src/main/java/org/schabi/newpipe/player/gesture/PopupPlayerGestureListener.kt index 70cfd1e95..60752652e 100644 --- a/app/src/main/java/org/schabi/newpipe/player/gesture/PopupPlayerGestureListener.kt +++ b/app/src/main/java/org/schabi/newpipe/player/gesture/PopupPlayerGestureListener.kt @@ -15,7 +15,7 @@ import org.schabi.newpipe.ktx.animate import org.schabi.newpipe.player.ui.PopupPlayerUi class PopupPlayerGestureListener( - private val playerUi: PopupPlayerUi, + private val playerUi: PopupPlayerUi ) : BasePlayerGestureListener(playerUi) { private var isMoving = false diff --git a/app/src/main/java/org/schabi/newpipe/player/mediabrowser/MediaBrowserImpl.kt b/app/src/main/java/org/schabi/newpipe/player/mediabrowser/MediaBrowserImpl.kt index b2ff4afd4..cc09765f4 100644 --- a/app/src/main/java/org/schabi/newpipe/player/mediabrowser/MediaBrowserImpl.kt +++ b/app/src/main/java/org/schabi/newpipe/player/mediabrowser/MediaBrowserImpl.kt @@ -47,7 +47,7 @@ import org.schabi.newpipe.util.image.ImageStrategy */ class MediaBrowserImpl( private val context: Context, - notifyChildrenChanged: Consumer, // parentId + notifyChildrenChanged: Consumer // parentId ) { private val packageValidator = PackageValidator(context) private val database = NewPipeDatabase.getInstance(context) @@ -204,12 +204,12 @@ class MediaBrowserImpl( val extras = Bundle() extras.putString( MediaConstants.DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_GROUP_TITLE, - context.resources.getString(R.string.tab_bookmarks), + context.resources.getString(R.string.tab_bookmarks) ) builder.setExtras(extras) return MediaBrowserCompat.MediaItem( builder.build(), - MediaBrowserCompat.MediaItem.FLAG_BROWSABLE, + MediaBrowserCompat.MediaItem.FLAG_BROWSABLE ) } @@ -266,7 +266,7 @@ class MediaBrowserImpl( private fun createLocalPlaylistStreamMediaItem( playlistId: Long, item: PlaylistStreamEntry, - index: Int, + index: Int ): MediaBrowserCompat.MediaItem { val builder = MediaDescriptionCompat.Builder() builder.setMediaId(createMediaIdForPlaylistIndex(false, playlistId, index)) @@ -283,7 +283,7 @@ class MediaBrowserImpl( private fun createRemotePlaylistStreamMediaItem( playlistId: Long, item: StreamInfoItem, - index: Int, + index: Int ): MediaBrowserCompat.MediaItem { val builder = MediaDescriptionCompat.Builder() builder.setMediaId(createMediaIdForPlaylistIndex(true, playlistId, index)) @@ -303,7 +303,7 @@ class MediaBrowserImpl( private fun createMediaIdForPlaylistIndex( isRemote: Boolean, playlistId: Long, - index: Int, + index: Int ): String { return buildLocalPlaylistItemMediaId(isRemote, playlistId) .appendPath(index.toString()) diff --git a/app/src/main/java/org/schabi/newpipe/player/mediabrowser/MediaBrowserPlaybackPreparer.kt b/app/src/main/java/org/schabi/newpipe/player/mediabrowser/MediaBrowserPlaybackPreparer.kt index 62e8032fd..a76eaf737 100644 --- a/app/src/main/java/org/schabi/newpipe/player/mediabrowser/MediaBrowserPlaybackPreparer.kt +++ b/app/src/main/java/org/schabi/newpipe/player/mediabrowser/MediaBrowserPlaybackPreparer.kt @@ -51,7 +51,7 @@ class MediaBrowserPlaybackPreparer( private val context: Context, private val setMediaSessionError: BiConsumer, // error string, error code private val clearMediaSessionError: Runnable, - private val onPrepare: Consumer, + private val onPrepare: Consumer ) : PlaybackPreparer { private val database = NewPipeDatabase.getInstance(context) private var disposable: Disposable? = null @@ -172,7 +172,7 @@ class MediaBrowserPlaybackPreparer( private fun extractPlayQueueFromPlaylistMediaId( mediaId: String, path: MutableList, - url: String?, + url: String? ): Single { if (path.isEmpty()) { throw parseError(mediaId) @@ -209,7 +209,7 @@ class MediaBrowserPlaybackPreparer( @Throws(ContentNotAvailableException::class) private fun extractPlayQueueFromHistoryMediaId( mediaId: String, - path: List, + path: List ): Single { if (path.size != 1) { throw parseError(mediaId) @@ -230,7 +230,7 @@ class MediaBrowserPlaybackPreparer( private fun extractPlayQueueFromInfoItemMediaId( mediaId: String, path: List, - url: String, + url: String ): Single { if (path.size != 2) { throw parseError(mediaId) diff --git a/app/src/main/java/org/schabi/newpipe/settings/export/ImportExportManager.kt b/app/src/main/java/org/schabi/newpipe/settings/export/ImportExportManager.kt index c9901d277..8154338ce 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/export/ImportExportManager.kt +++ b/app/src/main/java/org/schabi/newpipe/settings/export/ImportExportManager.kt @@ -31,7 +31,7 @@ class ImportExportManager(private val fileLocator: BackupFileLocator) { ZipHelper.addFileToZip( outZip, BackupFileLocator.FILE_NAME_DB, - fileLocator.db.path, + fileLocator.db.path ) // add the legacy vulnerable serialized preferences (will be removed in the future) @@ -78,7 +78,7 @@ class ImportExportManager(private val fileLocator: BackupFileLocator) { val success = ZipHelper.extractFileFromZip( file, BackupFileLocator.FILE_NAME_DB, - fileLocator.db.path, + fileLocator.db.path ) if (success) { diff --git a/app/src/main/java/org/schabi/newpipe/settings/notifications/NotificationModeConfigFragment.kt b/app/src/main/java/org/schabi/newpipe/settings/notifications/NotificationModeConfigFragment.kt index 581768c30..097200662 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/notifications/NotificationModeConfigFragment.kt +++ b/app/src/main/java/org/schabi/newpipe/settings/notifications/NotificationModeConfigFragment.kt @@ -45,7 +45,7 @@ class NotificationModeConfigFragment : Fragment() { override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, - savedInstanceState: Bundle?, + savedInstanceState: Bundle? ): View { _binding = FragmentChannelsNotificationsBinding.inflate(inflater, container, false) return binding.root diff --git a/app/src/main/java/org/schabi/newpipe/util/potoken/PoTokenWebView.kt b/app/src/main/java/org/schabi/newpipe/util/potoken/PoTokenWebView.kt index d222b1b1e..6ec41fc07 100644 --- a/app/src/main/java/org/schabi/newpipe/util/potoken/PoTokenWebView.kt +++ b/app/src/main/java/org/schabi/newpipe/util/potoken/PoTokenWebView.kt @@ -23,7 +23,7 @@ import org.schabi.newpipe.DownloaderImpl class PoTokenWebView private constructor( context: Context, // to be used exactly once only during initialization! - private val generatorEmitter: SingleEmitter, + private val generatorEmitter: SingleEmitter ) : PoTokenGenerator { private val webView = WebView(context) private val disposables = CompositeDisposable() // used only during initialization @@ -93,7 +93,7 @@ class PoTokenWebView private constructor( ), "text/html", "utf-8", - null, + null ) }, this::onInitializationErrorCloseAndCancel @@ -113,7 +113,7 @@ class PoTokenWebView private constructor( makeBotguardServiceRequest( "https://www.youtube.com/api/jnn/v1/Create", - "[ \"$REQUEST_KEY\" ]", + "[ \"$REQUEST_KEY\" ]" ) { responseBody -> val parsedChallengeData = parseChallengeData(responseBody) webView.evaluateJavascript( @@ -156,7 +156,7 @@ class PoTokenWebView private constructor( } makeBotguardServiceRequest( "https://www.youtube.com/api/jnn/v1/GenerateIT", - "[ \"$REQUEST_KEY\", \"$botguardResponse\" ]", + "[ \"$REQUEST_KEY\", \"$botguardResponse\" ]" ) { responseBody -> if (BuildConfig.DEBUG) { Log.d(TAG, "GenerateIT response: $responseBody") @@ -200,7 +200,7 @@ class PoTokenWebView private constructor( $JS_INTERFACE.onObtainPoTokenResult(identifier, poTokenU8String) } catch (error) { $JS_INTERFACE.onObtainPoTokenError(identifier, error + "\n" + error.stack) - }""", + }""" ) {} } } @@ -294,7 +294,7 @@ class PoTokenWebView private constructor( private fun makeBotguardServiceRequest( url: String, data: String, - handleResponseBody: (String) -> Unit, + handleResponseBody: (String) -> Unit ) { disposables.add( Single.fromCallable { @@ -306,7 +306,7 @@ class PoTokenWebView private constructor( "Accept" to listOf("application/json"), "Content-Type" to listOf("application/json+protobuf"), "x-goog-api-key" to listOf(GOOGLE_API_KEY), - "x-user-agent" to listOf("grpc-web-javascript/0.1"), + "x-user-agent" to listOf("grpc-web-javascript/0.1") ), data.toByteArray() ) @@ -385,7 +385,7 @@ class PoTokenWebView private constructor( */ private fun runOnMainThread( emitterIfPostFails: SingleEmitter, - runnable: Runnable, + runnable: Runnable ) { if (!Handler(Looper.getMainLooper()).post(runnable)) { emitterIfPostFails.onError(PoTokenException("Could not run on main thread")) diff --git a/app/src/test/java/org/schabi/newpipe/settings/ImportAllCombinationsTest.kt b/app/src/test/java/org/schabi/newpipe/settings/ImportAllCombinationsTest.kt index 314e3c484..b8dbf35dc 100644 --- a/app/src/test/java/org/schabi/newpipe/settings/ImportAllCombinationsTest.kt +++ b/app/src/test/java/org/schabi/newpipe/settings/ImportAllCombinationsTest.kt @@ -29,7 +29,7 @@ class ImportAllCombinationsTest { val containsSer: Ser, val containsJson: Boolean, val filename: String, - val throwable: Throwable, + val throwable: Throwable ) private fun testZipCombination( @@ -37,7 +37,7 @@ class ImportAllCombinationsTest { containsSer: Ser, containsJson: Boolean, filename: String, - runTest: (test: () -> Unit) -> Unit, + runTest: (test: () -> Unit) -> Unit ) { val zipFile = File(classloader.getResource(filename)?.file!!) val zip = Mockito.mock(StoredFileHelper::class.java, Mockito.withSettings().stubOnly())