Skip to content

Commit 0fc2d4c

Browse files
committed
Merge branch 'dev' into refactor
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2 parents 1bca5f3 + de6dc02 commit 0fc2d4c

File tree

5 files changed

+22
-9
lines changed

5 files changed

+22
-9
lines changed

app/build.gradle.kts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,6 @@ dependencies {
304304
implementation(libs.google.exoplayer.smoothstreaming)
305305
implementation(libs.google.exoplayer.ui)
306306

307-
// Metadata generator for service descriptors
308-
compileOnly(libs.google.autoservice.annotations)
309-
ksp(libs.google.autoservice.compiler)
310-
311307
// Manager for complex RecyclerView layouts
312308
implementation(libs.lisawray.groupie.core)
313309
implementation(libs.lisawray.groupie.viewbinding)
@@ -322,6 +318,8 @@ dependencies {
322318

323319
// Crash reporting
324320
implementation(libs.acra.core)
321+
compileOnly(libs.google.autoservice.annotations)
322+
ksp(libs.zacsweers.autoservice.compiler)
325323

326324
// Properly restarting
327325
implementation(libs.jakewharton.phoenix)

app/src/main/java/org/schabi/newpipe/database/history/dao/StreamHistoryDAO.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ abstract class StreamHistoryDAO : BasicDAO<StreamHistoryEntity> {
3535
abstract val historySortedById: Flowable<MutableList<StreamHistoryEntry>>
3636

3737
@Query("SELECT * FROM stream_history WHERE stream_id = :streamId ORDER BY access_date DESC LIMIT 1")
38-
abstract fun getLatestEntry(streamId: Long): StreamHistoryEntity
38+
abstract fun getLatestEntry(streamId: Long): StreamHistoryEntity?
3939

4040
@Query("DELETE FROM stream_history WHERE stream_id = :streamId")
4141
abstract fun deleteStreamHistory(streamId: Long): Int

app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1730,12 +1730,13 @@ class VideoDetailFragment :
17301730
}
17311731

17321732
override fun onFullscreenToggleButtonClicked() {
1733+
// On Android TV screen rotation is not supported
17331734
// In tablet user experience will be better if screen will not be rotated
17341735
// from landscape to portrait every time.
17351736
// Just turn on fullscreen mode in landscape orientation
17361737
// or portrait & unlocked global orientation
17371738
val isLandscape = DeviceUtils.isLandscape(requireContext())
1738-
if (DeviceUtils.isTablet(activity) &&
1739+
if (DeviceUtils.isTv(activity) || DeviceUtils.isTablet(activity) &&
17391740
(!PlayerHelper.globalScreenOrientationLocked(activity) || isLandscape)
17401741
) {
17411742
player!!.UIs().get(MainPlayerUi::class)?.toggleFullscreen()

app/src/main/java/org/schabi/newpipe/info_list/dialog/StreamDialogDefaultEntry.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
import org.schabi.newpipe.R;
1414
import org.schabi.newpipe.database.stream.model.StreamEntity;
1515
import org.schabi.newpipe.download.DownloadDialog;
16+
import org.schabi.newpipe.error.ErrorInfo;
17+
import org.schabi.newpipe.error.ErrorUtil;
18+
import org.schabi.newpipe.error.UserAction;
1619
import org.schabi.newpipe.local.dialog.PlaylistAppendDialog;
1720
import org.schabi.newpipe.local.dialog.PlaylistDialog;
1821
import org.schabi.newpipe.local.history.HistoryRecordManager;
@@ -133,6 +136,16 @@ public enum StreamDialogDefaultEntry {
133136
MARK_AS_WATCHED(R.string.mark_as_watched, (fragment, item) ->
134137
new HistoryRecordManager(fragment.getContext())
135138
.markAsWatched(item)
139+
.doOnError(error -> {
140+
ErrorUtil.showSnackbar(
141+
fragment.requireContext(),
142+
new ErrorInfo(
143+
error,
144+
UserAction.OPEN_INFO_ITEM_DIALOG,
145+
"Got an error when trying to mark as watched"
146+
)
147+
);
148+
})
136149
.onErrorComplete()
137150
.observeOn(AndroidSchedulers.mainThread())
138151
.subscribe()

gradle/libs.versions.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ acra = "5.13.1"
99
agp = "8.13.1"
1010
appcompat = "1.7.1"
1111
assertj = "3.27.6"
12-
autoservice = "1.1.1"
12+
autoservice-google = "1.1.1"
13+
autoservice-zacsweers = "1.2.0"
1314
bridge = "v2.0.2"
1415
cardview = "1.0.0"
1516
checkstyle = "12.1.2"
@@ -114,8 +115,7 @@ evernote-statesaver-core = { module = "com.evernote:android-state", version.ref
114115
facebook-stetho-core = { module = "com.facebook.stetho:stetho", version.ref = "stetho" }
115116
facebook-stetho-okhttp3 = { module = "com.facebook.stetho:stetho-okhttp3", version.ref = "stetho" }
116117
google-android-material = { module = "com.google.android.material:material", version.ref = "material" }
117-
google-autoservice-annotations = { module = "com.google.auto.service:auto-service-annotations", version.ref = "autoservice" }
118-
google-autoservice-compiler = { module = "com.google.auto.service:auto-service", version.ref = "autoservice" }
118+
google-autoservice-annotations = { module = "com.google.auto.service:auto-service-annotations", version.ref = "autoservice-google" }
119119
google-exoplayer-core = { module = "com.google.android.exoplayer:exoplayer-core", version.ref = "exoplayer" }
120120
google-exoplayer-dash = { module = "com.google.android.exoplayer:exoplayer-dash", version.ref = "exoplayer" }
121121
google-exoplayer-database = { module = "com.google.android.exoplayer:exoplayer-database", version.ref = "exoplayer" }
@@ -152,6 +152,7 @@ squareup-leakcanary-core = { module = "com.squareup.leakcanary:leakcanary-androi
152152
squareup-leakcanary-plumber = { module = "com.squareup.leakcanary:plumber-android", version.ref = "leakcanary" }
153153
squareup-leakcanary-watcher = { module = "com.squareup.leakcanary:leakcanary-object-watcher-android", version.ref = "leakcanary" }
154154
squareup-okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
155+
zacsweers-autoservice-compiler = { module = "dev.zacsweers.autoservice:auto-service-ksp", version.ref = "autoservice-zacsweers" }
155156

156157
[plugins]
157158
about-libraries = { id = "com.mikepenz.aboutlibraries.plugin", version.ref = "about-libraries" }

0 commit comments

Comments
 (0)