tesses-cms/Tesses.CMS/IContentProvider.cs

242 lines
8.1 KiB
C#
Raw Permalink Normal View History

2023-12-16 01:40:05 +00:00
using System.Collections.Generic;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace Tesses.CMS
{
public interface IContentProvider
{
UserAccount GetFirstUser();
IEnumerable<UserAccount> GetUsers();
IEnumerable<Movie> GetMovies(string user);
IEnumerable<Movie> GetMovies(long user);
2024-07-28 22:59:28 +00:00
IEnumerable<Album> GetAlbums(string user);
IEnumerable<Album> GetAlbums(long user);
2023-12-16 01:40:05 +00:00
UserAccount GetUserAccount(string user);
2024-07-28 22:59:28 +00:00
Movie CreateMovie(string user,string movie,string properName,string description);
Movie CreateMovie(long user,string movie,string properName,string description);
2023-12-16 01:40:05 +00:00
Movie GetMovie(string user,string movie);
void UpdateMovie(Movie movie);
void CreateUser(CMSConfiguration configuration,string user,string properName,string email,string password);
2024-07-28 22:59:28 +00:00
Album CreateAlbum(string user, string album, string properName,string description);
Album CreateAlbum(long user, string album, string properName,string description);
2024-01-04 02:53:13 +00:00
void UpdateUser(UserAccount account);
UserAccount GetUserById(long account);
void CreateSession(string session,long account);
void ChangeSession(string session,long account);
void DeleteSession(string session);
long? GetSession(string session);
bool ContainsSession(string cookie);
void CreateVerificationCode(string code,long account);
void DeleteVerificationCode(string code);
long? GetVerificationAccount(string code);
bool ContainsVerificationCode(string code);
IEnumerable<Show> GetShows(string user);
2024-07-28 22:59:28 +00:00
IEnumerable<Show> GetShows(long user);
2024-01-04 02:53:13 +00:00
void UpdateShow(Show show);
void UpdateEpisode(Episode episode);
void UpdateSeason(Season season);
2024-07-28 22:59:28 +00:00
Show CreateShow(long user, string show,string properName, string description);
2024-01-04 02:53:13 +00:00
Show CreateShow(string user, string show, string properName, string description);
Show GetShow(string user, string show);
2024-07-28 22:59:28 +00:00
Show GetShow(long user, long show);
int SeasonCount(long user,long show);
2024-01-04 02:53:13 +00:00
int SeasonCount(string user,string show);
Season GetSeason(string user,string show,int season);
2024-07-28 22:59:28 +00:00
Season GetSeason(long user, long show, int season);
2024-01-04 02:53:13 +00:00
Season CreateSeason(string user,string show,int season,string properName,string description);
2024-07-28 22:59:28 +00:00
Season CreateSeason(long user,long show,int season,string properName,string description);
2024-01-04 02:53:13 +00:00
int EpisodeCount(string user,string show,int season);
2024-07-28 22:59:28 +00:00
int EpisodeCount(long user,long show,int season);
2024-01-04 02:53:13 +00:00
Episode GetEpisode(string user,string show,int season,int episode);
2024-07-28 22:59:28 +00:00
Episode GetEpisode(long user,long show,int season,int episode);
2024-01-04 02:53:13 +00:00
Episode CreateEpisode(string user,string show,int season,int episode,string episodename,string properName,string description);
2024-07-28 22:59:28 +00:00
Episode CreateEpisode(long user,long show,int season,int episode,string episodename,string properName,string description);
Album GetAlbum(string user,string album);
Album GetAlbum(long user,string album);
void UpdateAlbum(Album album);
}
public class SeasonContentMetaData
{
[JsonProperty("season_info")]
public Season Info {get;set;}
[JsonProperty("has_poster")]
public bool HasPoster {get;set;}
[JsonProperty("poster_url")]
public string PosterUrl {get;set;}
[JsonProperty("has_thumbnail")]
public bool HasThumbnail {get;set;}
[JsonProperty("thumbnail_url")]
public string ThumbnailUrl {get;set;}
}
public class ShowContentMetaData
{
[JsonProperty("show_info")]
public Show Info {get;set;}
[JsonProperty("has_show_torrent")]
public bool HasShowTorrent{get;set;}
[JsonProperty("show_torrent_url")]
public string ShowTorrentUrl {get;set;}
[JsonProperty("has_show_with_extras_torrent")]
public bool HasShowWithExtrasTorrent{get;set;}
[JsonProperty("show_with_extras_torrent_url")]
public string ShowWithExtrasTorrentUrl {get;set;}
[JsonProperty("has_poster")]
public bool HasPoster {get;set;}
[JsonProperty("poster_url")]
public string PosterUrl {get;set;}
[JsonProperty("has_thumbnail")]
public bool HasThumbnail {get;set;}
[JsonProperty("thumbnail_url")]
public string ThumbnailUrl {get;set;}
[JsonProperty("extra_streams")]
public List<ExtraDataStream> ExtraStreams {get;set;}=new List<ExtraDataStream>();
}
public class AlbumContentMetaData
{
[JsonProperty("album_info")]
public Album Info {get;set;}
[JsonProperty("has_album_torrent")]
public bool HasAlbumTorrent{get;set;}
[JsonProperty("album_torrent_url")]
public string AlbumTorrentUrl {get;set;}
[JsonProperty("has_album_with_extras_torrent")]
public bool HasAlbumWithExtrasTorrent{get;set;}
[JsonProperty("album_with_extras_torrent_url")]
public string AlbumWithExtrasTorrentUrl {get;set;}
[JsonProperty("has_poster")]
public bool HasPoster {get;set;}
[JsonProperty("poster_url")]
public string PosterUrl {get;set;}
[JsonProperty("has_thumbnail")]
public bool HasThumbnail {get;set;}
[JsonProperty("thumbnail_url")]
public string ThumbnailUrl {get;set;}
[JsonProperty("extra_streams")]
public List<ExtraDataStream> ExtraStreams {get;set;}=new List<ExtraDataStream>();
[JsonProperty("browser_streams")]
public List<Track> BrowserStreams {get;set;}=new List<Track>();
[JsonProperty("download_streams")]
public List<Track> DownloadStreams {get;set;}=new List<Track>();
}
public class Track
{
[JsonProperty("track_number")]
public int TrackNumber {get;set;}
[JsonProperty("url")]
public string Url {get;set;}
[JsonProperty("name")]
public string Name {get;set;}
2023-12-16 01:40:05 +00:00
}
public class MovieContentMetaData
{
2024-07-28 22:59:28 +00:00
[JsonProperty("movie_info")]
public Movie Info {get;set;}
[JsonProperty("has_movie_torrent")]
public bool HasMovieTorrent{get;set;}
2023-12-16 01:40:05 +00:00
[JsonProperty("movie_torrent_url")]
public string MovieTorrentUrl {get;set;}
2024-07-28 22:59:28 +00:00
[JsonProperty("has_movie_with_extras_torrent")]
public bool HasMovieWithExtrasTorrent{get;set;}
2023-12-16 01:40:05 +00:00
[JsonProperty("movie_with_extras_torrent_url")]
public string MovieWithExtrasTorrentUrl {get;set;}
2024-07-28 22:59:28 +00:00
[JsonProperty("has_browser_stream")]
public bool HasBrowserStream {get;set;}
[JsonProperty("has_download_stream")]
public bool HasDownloadStream {get;set;}
2023-12-16 01:40:05 +00:00
[JsonProperty("browser_stream")]
public string BrowserStream {get;set;}
[JsonProperty("download_stream")]
public string DownloadStream {get;set;}
2024-07-28 22:59:28 +00:00
[JsonProperty("has_poster")]
public bool HasPoster {get;set;}
2023-12-16 01:40:05 +00:00
[JsonProperty("poster_url")]
public string PosterUrl {get;set;}
2024-07-28 22:59:28 +00:00
[JsonProperty("has_thumbnail")]
public bool HasThumbnail {get;set;}
2023-12-16 01:40:05 +00:00
[JsonProperty("thumbnail_url")]
public string ThumbnailUrl {get;set;}
[JsonProperty("subtitle_streams")]
public List<SubtitleStream> SubtitlesStreams {get;set;}=new List<SubtitleStream>();
[JsonProperty("extra_streams")]
public List<ExtraDataStream> ExtraStreams {get;set;}=new List<ExtraDataStream>();
}
public class ExtraDataStream
{
[JsonProperty("is_dir")]
public bool IsDir {get;set;}
[JsonProperty("name")]
public string Name {get;set;}
[JsonProperty("items")]
public List<ExtraDataStream> Items {get;set;}=new List<ExtraDataStream>();
[JsonProperty("url")]
public string Url {get;set;}
}
public class SubtitleStream
{
[JsonProperty("language_code")]
public string LanguageCode {get;set;}="";
2024-01-04 02:53:13 +00:00
[JsonProperty("srt_url")]
public string SrtUrl {get;set;}="";
2023-12-16 01:40:05 +00:00
2024-01-04 02:53:13 +00:00
[JsonProperty("vtt_url")]
public string VttUrl {get;set;}="";
2023-12-16 01:40:05 +00:00
}
}