//
// Build a streaming URL for a track. Jellyfin has /Audio/{id}/universal which
// transcodes if needed, but for now we'll prefer /Audio/{id}/stream.{ext} and
// transcode-fallback later.
//

build_stream_url :: (c: *Jellyfin_Client, track_id: string) -> string {
    return tprint("%/Audio/%/stream?api_key=%", c.server_url, track_id, c.auth_token);
}

// Download an entire track into memory, suitable to hand off to
// Sound_Player.load_audio_data().
download_track_bytes :: (c: *Jellyfin_Client, track_id: string) -> string, bool {
    path := tprint("/Audio/%/stream", track_id);
    resp := http_get(c, path);
    if !resp.ok  return "", false;
    return resp.body, true;
}
