Skip to content

Commit 3603ad5

Browse files
authored
Merge branch 'TeamNewPipe:dev' into handle-comment-replies-screens
2 parents 8610de1 + 3815f5f commit 3603ad5

133 files changed

Lines changed: 1057 additions & 1539 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/src/main/java/org/schabi/newpipe/ExitActivity.java

Lines changed: 0 additions & 50 deletions
This file was deleted.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2016-2026 NewPipe contributors <https://newpipe.net>
3+
* SPDX-License-Identifier: GPL-3.0-or-later
4+
*/
5+
6+
package org.schabi.newpipe
7+
8+
import android.annotation.SuppressLint
9+
import android.app.Activity
10+
import android.content.Intent
11+
import android.os.Bundle
12+
import org.schabi.newpipe.util.NavigationHelper
13+
14+
class ExitActivity : Activity() {
15+
@SuppressLint("NewApi")
16+
override fun onCreate(savedInstanceState: Bundle?) {
17+
super.onCreate(savedInstanceState)
18+
finishAndRemoveTask()
19+
NavigationHelper.restartApp(this)
20+
}
21+
22+
companion object {
23+
@JvmStatic
24+
fun exitAndRemoveFromRecentApps(activity: Activity) {
25+
val intent = Intent(activity, ExitActivity::class.java)
26+
intent.addFlags(
27+
Intent.FLAG_ACTIVITY_NEW_TASK
28+
or Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
29+
or Intent.FLAG_ACTIVITY_CLEAR_TASK
30+
or Intent.FLAG_ACTIVITY_NO_ANIMATION
31+
)
32+
33+
activity.startActivity(intent)
34+
}
35+
}
36+
}

app/src/main/java/org/schabi/newpipe/about/AboutActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class AboutActivity : AppCompatActivity() {
9292
return when (position) {
9393
posAbout -> AboutFragment()
9494
posLicense -> LicenseFragment.newInstance(SOFTWARE_COMPONENTS)
95-
else -> throw IllegalArgumentException("Unknown position for ViewPager2")
95+
else -> error("Unknown position for ViewPager2")
9696
}
9797
}
9898

@@ -105,7 +105,7 @@ class AboutActivity : AppCompatActivity() {
105105
return when (position) {
106106
posAbout -> R.string.tab_about
107107
posLicense -> R.string.tab_licenses
108-
else -> throw IllegalArgumentException("Unknown position for ViewPager2")
108+
else -> error("Unknown position for ViewPager2")
109109
}
110110
}
111111
}

app/src/main/java/org/schabi/newpipe/database/playlist/model/PlaylistRemoteEntity.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,7 @@ data class PlaylistRemoteEntity(
6262
orderingName = playlistInfo.name,
6363
url = playlistInfo.url,
6464
thumbnailUrl = ImageStrategy.imageListToDbUrl(
65-
if (playlistInfo.thumbnails.isEmpty()) {
66-
playlistInfo.uploaderAvatars
67-
} else {
68-
playlistInfo.thumbnails
69-
}
65+
playlistInfo.thumbnails.ifEmpty { playlistInfo.uploaderAvatars }
7066
),
7167
uploader = playlistInfo.uploaderName,
7268
streamCount = playlistInfo.streamCount

app/src/main/java/org/schabi/newpipe/database/stream/dao/StreamDAO.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ abstract class StreamDAO : BasicDAO<StreamEntity> {
8787

8888
private fun compareAndUpdateStream(newerStream: StreamEntity) {
8989
val existentMinimalStream = getMinimalStreamForCompare(newerStream.serviceId, newerStream.url)
90-
?: throw IllegalStateException("Stream cannot be null just after insertion.")
90+
?: error("Stream cannot be null just after insertion.")
9191
newerStream.uid = existentMinimalStream.uid
9292

9393
if (!StreamTypeUtil.isLiveStream(newerStream.streamType)) {

app/src/main/java/org/schabi/newpipe/database/subscription/SubscriptionDAO.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ abstract class SubscriptionDAO : BasicDAO<SubscriptionEntity> {
100100
entity.uid = uidFromInsert
101101
} else {
102102
val subscriptionIdFromDb = getSubscriptionIdInternal(entity.serviceId, entity.url!!)
103-
?: throw IllegalStateException("Subscription cannot be null just after insertion.")
103+
?: error("Subscription cannot be null just after insertion.")
104104
entity.uid = subscriptionIdFromDb
105105

106106
update(entity)

0 commit comments

Comments
 (0)