File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
app/src/main/java/de/christinecoenen/code/zapp Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import android.text.TextUtils
44import androidx.annotation.DrawableRes
55import de.christinecoenen.code.zapp.app.settings.repository.StreamQualityBucket
66import de.christinecoenen.code.zapp.models.channels.ChannelModel
7+ import de.christinecoenen.code.zapp.models.shows.MediathekShow
78import de.christinecoenen.code.zapp.models.shows.PersistedMediathekShow
89import de.christinecoenen.code.zapp.models.shows.Quality
910import java.io.Serializable
@@ -26,16 +27,21 @@ data class VideoInfo(
2627
2728 @JvmStatic
2829 fun fromShow (persistedShow : PersistedMediathekShow ): VideoInfo {
29- val show = persistedShow.mediathekShow
30+ return fromShow(persistedShow.mediathekShow)
31+ .apply {
32+ id = persistedShow.id
33+ filePath = persistedShow.downloadedVideoPath
34+ }
35+ }
3036
37+ @JvmStatic
38+ fun fromShow (show : MediathekShow ): VideoInfo {
3139 return VideoInfo (
3240 title = show.title,
3341 url = show.videoUrl
3442 ).apply {
35- id = persistedShow.id
3643 urlHighestQuality = show.getVideoUrl(Quality .High )
3744 urlLowestQuality = show.getVideoUrl(Quality .Low )
38- filePath = persistedShow.downloadedVideoPath
3945 subtitle = show.topic
4046 subtitleUrl = show.subtitleUrl
4147 hasDuration = true
Original file line number Diff line number Diff line change @@ -69,10 +69,7 @@ class MainActivity : ComponentActivity() {
6969 MediaCenterScreen (
7070 onShowSelected = { show ->
7171 backStack.add(
72- PlayerScreenLocation (
73- // TODO: extend VideoInfo::fromShow
74- VideoInfo (title = show.title, url = show.videoUrl)
75- )
72+ PlayerScreenLocation (VideoInfo .fromShow(show))
7673 )
7774 }
7875 )
You can’t perform that action at this time.
0 commit comments