From f37036faf2d6bd9809e805a680c0a136455be9fd Mon Sep 17 00:00:00 2001 From: Niels van Velzen Date: Thu, 5 Dec 2024 22:01:47 +0100 Subject: [PATCH] Make playbackController reference optional in ReportingHelper --- .../androidtv/util/apiclient/ReportingHelper.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/jellyfin/androidtv/util/apiclient/ReportingHelper.kt b/app/src/main/java/org/jellyfin/androidtv/util/apiclient/ReportingHelper.kt index 3df6093691..735b0f2167 100644 --- a/app/src/main/java/org/jellyfin/androidtv/util/apiclient/ReportingHelper.kt +++ b/app/src/main/java/org/jellyfin/androidtv/util/apiclient/ReportingHelper.kt @@ -25,7 +25,7 @@ class ReportingHelper( ) { fun reportStart( lifecycleOwner: LifecycleOwner, - playbackController: PlaybackController, + playbackController: PlaybackController?, item: BaseItemDto, streamInfo: StreamInfo, position: Long, @@ -43,8 +43,8 @@ class ReportingHelper( PlayMethod.DirectStream -> org.jellyfin.sdk.model.api.PlayMethod.DIRECT_STREAM PlayMethod.DirectPlay -> org.jellyfin.sdk.model.api.PlayMethod.DIRECT_PLAY }, - audioStreamIndex = playbackController.audioStreamIndex, - subtitleStreamIndex = playbackController.subtitleStreamIndex, + audioStreamIndex = playbackController?.audioStreamIndex, + subtitleStreamIndex = playbackController?.subtitleStreamIndex, isMuted = false, repeatMode = RepeatMode.REPEAT_NONE, playbackOrder = PlaybackOrder.DEFAULT, @@ -61,7 +61,7 @@ class ReportingHelper( fun reportProgress( lifecycleOwner: LifecycleOwner, - playbackController: PlaybackController, + playbackController: PlaybackController?, item: BaseItemDto, streamInfo: StreamInfo, position: Long, @@ -79,8 +79,8 @@ class ReportingHelper( PlayMethod.DirectStream -> org.jellyfin.sdk.model.api.PlayMethod.DIRECT_STREAM PlayMethod.DirectPlay -> org.jellyfin.sdk.model.api.PlayMethod.DIRECT_PLAY }, - audioStreamIndex = playbackController.audioStreamIndex, - subtitleStreamIndex = playbackController.subtitleStreamIndex, + audioStreamIndex = playbackController?.audioStreamIndex, + subtitleStreamIndex = playbackController?.subtitleStreamIndex, isMuted = false, repeatMode = RepeatMode.REPEAT_NONE, playbackOrder = PlaybackOrder.DEFAULT,