package com.fabledsword.minstrel.player

import com.fabledsword.minstrel.models.TrackRef
import kotlinx.serialization.Serializable

/**
 * The JSON-serialized shape persisted in
 * `cached_resume_state.json` by [ResumeController]. Versioned via the
 * `schema` field so a future change can read old snapshots safely
 * (decode → drop on mismatch rather than crash).
 */
@Serializable
data class ResumePayload(
    val schema: Int = SCHEMA_VERSION,
    val tracks: List<TrackRef>,
    val queueIndex: Int,
    val positionMs: Long,
    val source: String? = null,
) {
    companion object {
        const val SCHEMA_VERSION: Int = 1
    }
}
