using System.Collections.ObjectModel;
using Newtonsoft.Json;
namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
{
///
/// Enum representing whether the playlist on TubeArchivist belongs from YouTube or is created by the user.
///
public enum PlaylistType
{
///
/// Playlist belongs from YouTube.
///
Regular,
///
/// Playlist created by the user.
///
Custom
}
///
/// A class representing TubeArchivist API playlist data.
///
public class Playlist
{
///
/// Initializes a new instance of the class.
///
/// URL of the channel banner image.
/// Playlist channel name.
/// Playlist channel YouTube id.
/// Playlist description.
/// Playlist videos.
/// Playlist YouTube id.
/// Playlist name.
/// URL of the playlist thumbnail.
/// Type of the playlist. See .
public Playlist(
bool isActive,
string channel,
string channelId,
string description,
Collection entries,
string id,
string name,
string thumbnailUrl, // TODO: Check if settable on Jellyfin
PlaylistType type)
{
this.IsActive = isActive;
this.Channel = channel;
this.ChannelId = channelId;
this.Description = description;
this.Entries = entries;
this.Id = id;
this.Name = name;
this.ThumbnailUrl = thumbnailUrl;
this.Type = type;
}
///
/// Gets or sets a value indicating whether the playlist is active or not.
///
[JsonProperty(PropertyName = "playlist_active")]
public bool IsActive { get; set; }
///
/// Gets or sets the playlist channel name.
///
[JsonProperty(PropertyName = "playlist_channel")]
public string Channel { get; set; }
///
/// Gets or sets the playlist channel YouTube id.
///
[JsonProperty(PropertyName = "playlist_channel_id")]
public string ChannelId { get; set; }
///
/// Gets or sets the playlist description.
///
[JsonProperty(PropertyName = "playlist_description")]
public string Description { get; set; }
///
/// Gets the playlist videos.
///
[JsonProperty(PropertyName = "playlist_entries")]
public Collection Entries { get; }
///
/// Gets or sets the playlist YouTube id.
///
[JsonProperty(PropertyName = "playlist_id")]
public string Id { get; set; }
///
/// Gets or sets the playlist name.
///
[JsonProperty(PropertyName = "playlist_name")]
public string Name { get; set; }
///
/// Gets or sets the playlist thumbnail URL.
///
[JsonProperty(PropertyName = "playlist_thumbnail")]
public string ThumbnailUrl { get; set; }
///
/// Gets or sets the playlist type.
///
/// One of the values indicating the playlist's type.
[JsonProperty(PropertyName = "playlist_type")]
public PlaylistType Type { get; set; }
}
}