using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace Jellyfin.Plugin.Chaosflix.Api.Models;
///
/// A conference as streaming.media.ccc.de describes it while it is running. The shape
/// follows the generator at voc/streaming-website (view/streams-json-v2.php); outside a
/// congress the endpoint answers with an empty list.
///
public class CccLiveConference
{
/// Gets or sets the conference title.
[JsonPropertyName("conference")]
public string Conference { get; set; } = string.Empty;
/// Gets or sets the acronym, e.g. "39c3".
[JsonPropertyName("slug")]
public string Slug { get; set; } = string.Empty;
///
/// Gets or sets a value indicating whether anything is on air right now. The site sets
/// it from the rooms' schedules, which is what decides whether the channel offers a
/// live folder at all.
///
[JsonPropertyName("isCurrentlyStreaming")]
public bool IsCurrentlyStreaming { get; set; }
/// Gets or sets the room groups.
[JsonPropertyName("groups")]
public List Groups { get; set; } = new();
}
/// A named set of rooms, e.g. "Live" or "Selfhosted".
public class CccLiveGroup
{
/// Gets or sets the group name.
[JsonPropertyName("group")]
public string Group { get; set; } = string.Empty;
/// Gets or sets the rooms.
[JsonPropertyName("rooms")]
public List Rooms { get; set; } = new();
}
/// One room with its stream variants and what is on in it.
public class CccLiveRoom
{
/// Gets or sets the room slug, e.g. "halla".
[JsonPropertyName("slug")]
public string Slug { get; set; } = string.Empty;
/// Gets or sets the display name, e.g. "Adams".
[JsonPropertyName("display")]
public string Display { get; set; } = string.Empty;
/// Gets or sets the thumbnail url.
[JsonPropertyName("thumb")]
public string? Thumb { get; set; }
/// Gets or sets the room's page on the streaming site.
[JsonPropertyName("link")]
public string? Link { get; set; }
/// Gets or sets what is running now and next.
[JsonPropertyName("talks")]
public CccLiveTalks? Talks { get; set; }
/// Gets or sets the stream variants.
[JsonPropertyName("streams")]
public List Streams { get; set; } = new();
}
/// The talk on air and the one after it; both are null between talks.
public class CccLiveTalks
{
/// Gets or sets the talk currently on air.
[JsonPropertyName("current")]
public CccLiveTalk? Current { get; set; }
/// Gets or sets the next talk.
[JsonPropertyName("next")]
public CccLiveTalk? Next { get; set; }
}
/// A scheduled talk, as the streaming site reports it.
public class CccLiveTalk
{
/// Gets or sets the title.
[JsonPropertyName("title")]
public string? Title { get; set; }
/// Gets or sets the speakers, already joined by the site.
[JsonPropertyName("speaker")]
public string? Speaker { get; set; }
}
///
/// One way to watch a room: a resolution, a language and a player type. "native" is the
/// floor language, "translated" an interpreter's channel.
///
public class CccLiveStreamVariant
{
/// Gets or sets the variant slug, e.g. "hd-native".
[JsonPropertyName("slug")]
public string Slug { get; set; } = string.Empty;
/// Gets or sets the human readable description.
[JsonPropertyName("display")]
public string Display { get; set; } = string.Empty;
/// Gets or sets the player type: video, slides, audio, music or dash.
[JsonPropertyName("type")]
public string Type { get; set; } = string.Empty;
/// Gets or sets a value indicating whether this is an interpreter's channel.
[JsonPropertyName("isTranslated")]
public bool IsTranslated { get; set; }
/// Gets or sets width and height, absent for audio.
[JsonPropertyName("videoSize")]
public List? VideoSize { get; set; }
/// Gets or sets the urls by protocol ("hls", "webm", "dash", "mp3", "opus").
[JsonPropertyName("urls")]
public Dictionary Urls { get; set; } = new();
}
/// One protocol's url for a stream variant.
public class CccLiveStreamUrl
{
/// Gets or sets the description the site shows for it.
[JsonPropertyName("display")]
public string? Display { get; set; }
/// Gets or sets the technical description, e.g. "hls".
[JsonPropertyName("tech")]
public string? Tech { get; set; }
/// Gets or sets the stream url.
[JsonPropertyName("url")]
public string Url { get; set; } = string.Empty;
}