package org.libre.agosto.p2play.models

import android.util.JsonReader

class StreamingModel(
    var playlistUrl: String = "",
    var segmentsSha256Url: String = "",
    // TODO: Download Files
) {
    fun parse(data: JsonReader) {
        data.beginObject()
        while (data.hasNext()) {
            val key = data.nextName()
            when (key.toString()) {
                "playlistUrl" -> {
                    this.playlistUrl = data.nextString()
                }
                "segmentsSha256Url" -> {
                    this.segmentsSha256Url = data.nextString()
                }
                else -> data.skipValue()
            }
        }
        data.endObject()
    }
}
