This commit is contained in:
Bnyro 2022-07-29 09:04:00 +02:00
parent 0f1743c35a
commit 838b9bed64
6 changed files with 3 additions and 5 deletions

View File

@ -810,7 +810,7 @@ class PlayerFragment : Fragment() {
playlist = RetrofitInstance.api.getPlaylist(playlistId!!)
// save the playlist urls in the array
playlist.relatedStreams?.forEach { video ->
playlistStreamIds += video.url?.toID()
playlistStreamIds += video.url.toID()
}
// save playlistNextPage for usage if video is not contained
playlistNextPage = playlist.nextpage

View File

@ -16,7 +16,7 @@ object PreferenceHelper {
private lateinit var prefContext: Context
private lateinit var settings: SharedPreferences
private lateinit var editor: SharedPreferences.Editor
val mapper = ObjectMapper()
private val mapper = ObjectMapper()
/**
* set the context that is being used to access the shared preferences
@ -136,7 +136,6 @@ object PreferenceHelper {
streams.duration
)
val mapper = ObjectMapper()
val watchHistory = getWatchHistory()
watchHistory += watchHistoryItem
@ -146,7 +145,6 @@ object PreferenceHelper {
}
fun removeFromWatchHistory(videoId: String) {
val mapper = ObjectMapper()
val watchHistory = getWatchHistory()
var indexToRemove: Int? = null
@ -220,7 +218,7 @@ object PreferenceHelper {
}
fun setLatestVideoId(videoId: String) {
setString(PreferenceKeys.LAST_STREAM_VIDEO_ID, videoId)
editor.putString(PreferenceKeys.LAST_STREAM_VIDEO_ID, videoId)
}
fun getLatestVideoId(): String {