Skip to content

Commit 892a1df

Browse files
committed
Merge remote-tracking branch 'origin/dev' into notifications-1
2 parents 44fa984 + d8236bb commit 892a1df

32 files changed

Lines changed: 599 additions & 318 deletions

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ ext {
106106
androidxWorkVersion = '2.5.0'
107107

108108
icepickVersion = '3.2.0'
109-
exoPlayerVersion = '2.12.3'
109+
exoPlayerVersion = '2.14.2'
110110
googleAutoServiceVersion = '1.0'
111111
groupieVersion = '2.10.0'
112112
markwonVersion = '4.6.2'
@@ -190,7 +190,7 @@ dependencies {
190190
// name and the commit hash with the commit hash of the (pushed) commit you want to test
191191
// This works thanks to JitPack: https://jitpack.io/
192192
implementation 'com.github.TeamNewPipe:nanojson:1d9e1aea9049fc9f85e68b43ba39fe7be1c1f751'
193-
implementation 'com.github.TeamNewPipe:NewPipeExtractor:4f60225ddc'
193+
implementation 'com.github.TeamNewPipe:NewPipeExtractor:7e7b78f1b3'
194194

195195
/** Checkstyle **/
196196
checkstyle "com.puppycrawl.tools:checkstyle:${checkstyleVersion}"

app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,12 @@
340340
<data android:host="skeptikon.fr" />
341341

342342
<data android:pathPrefix="/videos/" /> <!-- it contains playlists -->
343+
<data android:pathPrefix="/w/" /> <!-- short video URLs -->
344+
<data android:pathPrefix="/w/p/" /> <!-- short playlist URLs -->
343345
<data android:pathPrefix="/accounts/" />
346+
<data android:pathPrefix="/a/" /> <!-- short account URLs -->
344347
<data android:pathPrefix="/video-channels/" />
348+
<data android:pathPrefix="/c/" /> <!-- short video-channels URLs -->
345349
</intent-filter>
346350

347351
<!-- Bandcamp filter for tracks, albums and playlists -->

app/src/main/java/org/schabi/newpipe/database/feed/dao/FeedDAO.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import androidx.room.Query
77
import androidx.room.Transaction
88
import androidx.room.Update
99
import io.reactivex.rxjava3.core.Flowable
10+
import io.reactivex.rxjava3.core.Maybe
1011
import org.schabi.newpipe.database.feed.model.FeedEntity
1112
import org.schabi.newpipe.database.feed.model.FeedLastUpdatedEntity
1213
import org.schabi.newpipe.database.stream.StreamWithState
@@ -37,7 +38,7 @@ abstract class FeedDAO {
3738
LIMIT 500
3839
"""
3940
)
40-
abstract fun getAllStreams(): Flowable<List<StreamWithState>>
41+
abstract fun getAllStreams(): Maybe<List<StreamWithState>>
4142

4243
@Query(
4344
"""
@@ -62,7 +63,7 @@ abstract class FeedDAO {
6263
LIMIT 500
6364
"""
6465
)
65-
abstract fun getAllStreamsForGroup(groupId: Long): Flowable<List<StreamWithState>>
66+
abstract fun getAllStreamsForGroup(groupId: Long): Maybe<List<StreamWithState>>
6667

6768
/**
6869
* @see StreamStateEntity.isFinished()
@@ -97,7 +98,7 @@ abstract class FeedDAO {
9798
LIMIT 500
9899
"""
99100
)
100-
abstract fun getLiveOrNotPlayedStreams(): Flowable<List<StreamWithState>>
101+
abstract fun getLiveOrNotPlayedStreams(): Maybe<List<StreamWithState>>
101102

102103
/**
103104
* @see StreamStateEntity.isFinished()
@@ -137,7 +138,7 @@ abstract class FeedDAO {
137138
LIMIT 500
138139
"""
139140
)
140-
abstract fun getLiveOrNotPlayedStreamsForGroup(groupId: Long): Flowable<List<StreamWithState>>
141+
abstract fun getLiveOrNotPlayedStreamsForGroup(groupId: Long): Maybe<List<StreamWithState>>
141142

142143
@Query(
143144
"""

app/src/main/java/org/schabi/newpipe/fragments/list/BaseListFragment.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,13 @@ protected void showStreamDialog(final StreamInfoItem item) {
378378
if (KoreUtils.shouldShowPlayWithKodi(context, item.getServiceId())) {
379379
entries.add(StreamDialogEntry.play_with_kodi);
380380
}
381+
382+
// show "mark as watched" only when watch history is enabled
383+
if (StreamDialogEntry.shouldAddMarkAsWatched(item.getStreamType(), context)) {
384+
entries.add(
385+
StreamDialogEntry.mark_as_watched
386+
);
387+
}
381388
if (!isNullOrEmpty(item.getUploaderUrl())) {
382389
entries.add(StreamDialogEntry.show_channel_details);
383390
}

app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,12 @@ protected void showStreamDialog(final StreamInfoItem item) {
176176
entries.add(StreamDialogEntry.play_with_kodi);
177177
}
178178

179+
// show "mark as watched" only when watch history is enabled
180+
if (StreamDialogEntry.shouldAddMarkAsWatched(item.getStreamType(), context)) {
181+
entries.add(
182+
StreamDialogEntry.mark_as_watched
183+
);
184+
}
179185
if (!isNullOrEmpty(item.getUploaderUrl())) {
180186
entries.add(StreamDialogEntry.show_channel_details);
181187
}

app/src/main/java/org/schabi/newpipe/ktx/View.kt

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,18 +299,36 @@ private fun View.animateLightSlideAndAlpha(enterOrExit: Boolean, duration: Long,
299299
}
300300
}
301301

302-
fun View.slideUp(duration: Long, delay: Long, @FloatRange(from = 0.0, to = 1.0) translationPercent: Float) {
302+
fun View.slideUp(
303+
duration: Long,
304+
delay: Long,
305+
@FloatRange(from = 0.0, to = 1.0) translationPercent: Float
306+
) {
307+
slideUp(duration, delay, translationPercent, null)
308+
}
309+
310+
fun View.slideUp(
311+
duration: Long,
312+
delay: Long = 0L,
313+
@FloatRange(from = 0.0, to = 1.0) translationPercent: Float = 1.0F,
314+
execOnEnd: Runnable? = null
315+
) {
303316
val newTranslationY = (resources.displayMetrics.heightPixels * translationPercent).toInt()
304317
animate().setListener(null).cancel()
305318
alpha = 0f
306319
translationY = newTranslationY.toFloat()
307-
visibility = View.VISIBLE
320+
isVisible = true
308321
animate()
309322
.alpha(1f)
310323
.translationY(0f)
311324
.setStartDelay(delay)
312325
.setDuration(duration)
313326
.setInterpolator(FastOutSlowInInterpolator())
327+
.setListener(object : AnimatorListenerAdapter() {
328+
override fun onAnimationEnd(animation: Animator) {
329+
execOnEnd?.run()
330+
}
331+
})
314332
.start()
315333
}
316334

app/src/main/java/org/schabi/newpipe/local/feed/FeedDatabaseManager.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class FeedDatabaseManager(context: Context) {
4242
fun getStreams(
4343
groupId: Long = FeedGroupEntity.GROUP_ALL_ID,
4444
getPlayedStreams: Boolean = true
45-
): Flowable<List<StreamWithState>> {
45+
): Maybe<List<StreamWithState>> {
4646
return when (groupId) {
4747
FeedGroupEntity.GROUP_ALL_ID -> {
4848
if (getPlayedStreams) feedTable.getAllStreams()

0 commit comments

Comments
 (0)