player language settings [Part 2]

* move player object to PlayerViewModel
* minor code clean up
This commit is contained in:
2020-12-26 20:09:35 +01:00
parent 8a43567737
commit 94da8c6cee
7 changed files with 151 additions and 90 deletions

View File

@ -49,7 +49,7 @@ data class Media(
val link: String,
val type: DataTypes.MediaType,
val info: Info = Info(),
var episodes: ArrayList<Episode> = arrayListOf()
val episodes: ArrayList<Episode> = arrayListOf()
) {
fun hasEpisode(id: Int) = episodes.any { it.id == id }
fun getEpisodeById(id: Int) = episodes.first { it.id == id }
@ -71,11 +71,11 @@ data class Info(
data class Episode(
val id: Int = 0,
val streams: MutableList<Stream> = mutableListOf(),
var title: String = "",
var posterUrl: String = "",
var description: String = "",
val title: String = "",
val posterUrl: String = "",
val description: String = "",
var shortDesc: String = "",
var number: Int = 0,
val number: Int = 0,
var watched: Boolean = false,
var watchedCallback: String = ""
) {