LibreTube/app/src/main/java/com/github/libretube/obj/Streams.kt

96 lines
3.0 KiB
Kotlin
Raw Normal View History

2022-02-01 21:22:06 +05:30
package com.github.libretube.obj
2021-12-18 16:34:14 +05:30
import android.os.Parcel
import android.os.Parcelable
2022-02-08 21:04:42 +05:30
import com.fasterxml.jackson.annotation.JsonIgnoreProperties
2021-12-18 16:34:14 +05:30
2022-02-08 21:04:42 +05:30
@JsonIgnoreProperties(ignoreUnknown = true)
2021-12-18 16:34:14 +05:30
data class Streams(
val title: String?,
val description: String?,
val uploadDate: String?,
val uploader: String?,
val uploaderUrl: String?,
val uploaderAvatar: String?,
val thumbnailUrl: String?,
val hls: String?,
val dash: String?,
val lbryId: String?,
val uploaderVerified: Boolean?,
val duration: Int?,
val views: Long?,
val likes: Long?,
2021-12-18 16:34:14 +05:30
val dislikes: Int?,
val audioStreams: List<PipedStream>?,
val videoStreams: List<PipedStream>?,
val relatedStreams: List<StreamItem>?,
val subtitles: List<Subtitle>?,
val livestream: Boolean?,
val proxyUrl: String?,
val chapters: List<ChapterSegment>?
) : Parcelable {
constructor(parcel: Parcel) : this(
parcel.readString(),
parcel.readString(),
parcel.readString(),
parcel.readString(),
parcel.readString(),
parcel.readString(),
parcel.readString(),
parcel.readString(),
parcel.readString(),
parcel.readString(),
parcel.readValue(Boolean::class.java.classLoader) as? Boolean,
parcel.readValue(Int::class.java.classLoader) as? Int,
parcel.readValue(Long::class.java.classLoader) as? Long,
parcel.readValue(Long::class.java.classLoader) as? Long,
parcel.readValue(Int::class.java.classLoader) as? Int,
TODO("audioStreams"),
TODO("videoStreams"),
TODO("relatedStreams"),
TODO("subtitles"),
parcel.readValue(Boolean::class.java.classLoader) as? Boolean,
parcel.readString(),
TODO("chapters")
2022-06-03 22:21:27 +05:30
)
2022-05-20 03:52:10 +05:30
constructor() : this(
"", "", "", "", "", "", "", "", "", "", null, -1, -1, -1, -1, emptyList(), emptyList(),
emptyList(), emptyList(), null, "", emptyList()
)
override fun writeToParcel(parcel: Parcel, flags: Int) {
parcel.writeString(title)
parcel.writeString(description)
parcel.writeString(uploadDate)
parcel.writeString(uploader)
parcel.writeString(uploaderUrl)
parcel.writeString(uploaderAvatar)
parcel.writeString(thumbnailUrl)
parcel.writeString(hls)
parcel.writeString(dash)
parcel.writeString(lbryId)
parcel.writeValue(uploaderVerified)
parcel.writeValue(duration)
parcel.writeValue(views)
parcel.writeValue(likes)
parcel.writeValue(dislikes)
parcel.writeValue(livestream)
parcel.writeString(proxyUrl)
}
override fun describeContents(): Int {
return 0
}
companion object CREATOR : Parcelable.Creator<Streams> {
override fun createFromParcel(parcel: Parcel): Streams {
return Streams(parcel)
}
override fun newArray(size: Int): Array<Streams?> {
return arrayOfNulls(size)
}
}
2021-12-18 16:34:14 +05:30
}