diff options
| author | Andrew Rabert <ar@nullsum.net> | 2018-12-27 18:27:57 -0500 |
|---|---|---|
| committer | Andrew Rabert <ar@nullsum.net> | 2018-12-27 18:27:57 -0500 |
| commit | a86b71899ec52c44ddc6c3018e8cc5e9d7ff4d62 (patch) | |
| tree | a74f6ea4a8abfa1664a605d31d48bc38245ccf58 /MediaBrowser.Model/Entities | |
| parent | 9bac3ac616b01f67db98381feb09d34ebe821f9a (diff) | |
Add GPL modules
Diffstat (limited to 'MediaBrowser.Model/Entities')
30 files changed, 1456 insertions, 0 deletions
diff --git a/MediaBrowser.Model/Entities/ChapterInfo.cs b/MediaBrowser.Model/Entities/ChapterInfo.cs new file mode 100644 index 000000000..c24ca553b --- /dev/null +++ b/MediaBrowser.Model/Entities/ChapterInfo.cs @@ -0,0 +1,31 @@ +using System; + +namespace MediaBrowser.Model.Entities +{ + /// <summary> + /// Class ChapterInfo + /// </summary> + public class ChapterInfo + { + /// <summary> + /// Gets or sets the start position ticks. + /// </summary> + /// <value>The start position ticks.</value> + public long StartPositionTicks { get; set; } + + /// <summary> + /// Gets or sets the name. + /// </summary> + /// <value>The name.</value> + public string Name { get; set; } + + /// <summary> + /// Gets or sets the image path. + /// </summary> + /// <value>The image path.</value> + public string ImagePath { get; set; } + public DateTime ImageDateModified { get; set; } + + public string ImageTag { get; set; } + } +} diff --git a/MediaBrowser.Model/Entities/CollectionType.cs b/MediaBrowser.Model/Entities/CollectionType.cs new file mode 100644 index 000000000..f49e73c16 --- /dev/null +++ b/MediaBrowser.Model/Entities/CollectionType.cs @@ -0,0 +1,58 @@ +namespace MediaBrowser.Model.Entities +{ + public static class CollectionType + { + public const string Movies = "movies"; + + public const string TvShows = "tvshows"; + + public const string Music = "music"; + + public const string MusicVideos = "musicvideos"; + + public const string Trailers = "trailers"; + + public const string HomeVideos = "homevideos"; + + public const string BoxSets = "boxsets"; + + public const string Books = "books"; + public const string Photos = "photos"; + public const string Games = "games"; + public const string LiveTv = "livetv"; + public const string Playlists = "playlists"; + public const string Folders = "folders"; + } + + public static class SpecialFolder + { + public const string TvShowSeries = "TvShowSeries"; + public const string TvGenres = "TvGenres"; + public const string TvGenre = "TvGenre"; + public const string TvLatest = "TvLatest"; + public const string TvNextUp = "TvNextUp"; + public const string TvResume = "TvResume"; + public const string TvFavoriteSeries = "TvFavoriteSeries"; + public const string TvFavoriteEpisodes = "TvFavoriteEpisodes"; + + public const string MovieLatest = "MovieLatest"; + public const string MovieResume = "MovieResume"; + public const string MovieMovies = "MovieMovies"; + public const string MovieCollections = "MovieCollections"; + public const string MovieFavorites = "MovieFavorites"; + public const string MovieGenres = "MovieGenres"; + public const string MovieGenre = "MovieGenre"; + + public const string MusicArtists = "MusicArtists"; + public const string MusicAlbumArtists = "MusicAlbumArtists"; + public const string MusicAlbums = "MusicAlbums"; + public const string MusicGenres = "MusicGenres"; + public const string MusicLatest = "MusicLatest"; + public const string MusicPlaylists = "MusicPlaylists"; + public const string MusicSongs = "MusicSongs"; + public const string MusicFavorites = "MusicFavorites"; + public const string MusicFavoriteArtists = "MusicFavoriteArtists"; + public const string MusicFavoriteAlbums = "MusicFavoriteAlbums"; + public const string MusicFavoriteSongs = "MusicFavoriteSongs"; + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Entities/DisplayPreferences.cs b/MediaBrowser.Model/Entities/DisplayPreferences.cs new file mode 100644 index 000000000..dc386f775 --- /dev/null +++ b/MediaBrowser.Model/Entities/DisplayPreferences.cs @@ -0,0 +1,99 @@ +using MediaBrowser.Model.Drawing; +using System; +using System.Collections.Generic; + +namespace MediaBrowser.Model.Entities +{ + /// <summary> + /// Defines the display preferences for any item that supports them (usually Folders) + /// </summary> + public class DisplayPreferences + { + /// <summary> + /// The image scale + /// </summary> + private const double ImageScale = .9; + + /// <summary> + /// Initializes a new instance of the <see cref="DisplayPreferences" /> class. + /// </summary> + public DisplayPreferences() + { + RememberIndexing = false; + PrimaryImageHeight = 250; + PrimaryImageWidth = 250; + ShowBackdrop = true; + CustomPrefs = new Dictionary<string, string>(); + } + + /// <summary> + /// Gets or sets the user id. + /// </summary> + /// <value>The user id.</value> + public string Id { get; set; } + /// <summary> + /// Gets or sets the type of the view. + /// </summary> + /// <value>The type of the view.</value> + public string ViewType { get; set; } + /// <summary> + /// Gets or sets the sort by. + /// </summary> + /// <value>The sort by.</value> + public string SortBy { get; set; } + /// <summary> + /// Gets or sets the index by. + /// </summary> + /// <value>The index by.</value> + public string IndexBy { get; set; } + /// <summary> + /// Gets or sets a value indicating whether [remember indexing]. + /// </summary> + /// <value><c>true</c> if [remember indexing]; otherwise, <c>false</c>.</value> + public bool RememberIndexing { get; set; } + /// <summary> + /// Gets or sets the height of the primary image. + /// </summary> + /// <value>The height of the primary image.</value> + public int PrimaryImageHeight { get; set; } + /// <summary> + /// Gets or sets the width of the primary image. + /// </summary> + /// <value>The width of the primary image.</value> + public int PrimaryImageWidth { get; set; } + /// <summary> + /// Gets or sets the custom prefs. + /// </summary> + /// <value>The custom prefs.</value> + public Dictionary<string, string> CustomPrefs { get; set; } + /// <summary> + /// Gets or sets the scroll direction. + /// </summary> + /// <value>The scroll direction.</value> + public ScrollDirection ScrollDirection { get; set; } + /// <summary> + /// Gets or sets a value indicating whether to show backdrops on this item. + /// </summary> + /// <value><c>true</c> if showing backdrops; otherwise, <c>false</c>.</value> + public bool ShowBackdrop { get; set; } + /// <summary> + /// Gets or sets a value indicating whether [remember sorting]. + /// </summary> + /// <value><c>true</c> if [remember sorting]; otherwise, <c>false</c>.</value> + public bool RememberSorting { get; set; } + /// <summary> + /// Gets or sets the sort order. + /// </summary> + /// <value>The sort order.</value> + public SortOrder SortOrder { get; set; } + /// <summary> + /// Gets or sets a value indicating whether [show sidebar]. + /// </summary> + /// <value><c>true</c> if [show sidebar]; otherwise, <c>false</c>.</value> + public bool ShowSidebar { get; set; } + /// <summary> + /// Gets or sets the client + /// </summary> + public string Client { get; set; } + } +} diff --git a/MediaBrowser.Model/Entities/EmptyRequestResult.cs b/MediaBrowser.Model/Entities/EmptyRequestResult.cs new file mode 100644 index 000000000..5c9a725fd --- /dev/null +++ b/MediaBrowser.Model/Entities/EmptyRequestResult.cs @@ -0,0 +1,7 @@ + +namespace MediaBrowser.Model.Entities +{ + public class EmptyRequestResult + { + } +} diff --git a/MediaBrowser.Model/Entities/ExtraType.cs b/MediaBrowser.Model/Entities/ExtraType.cs new file mode 100644 index 000000000..ab8da58c0 --- /dev/null +++ b/MediaBrowser.Model/Entities/ExtraType.cs @@ -0,0 +1,16 @@ + +namespace MediaBrowser.Model.Entities +{ + public enum ExtraType + { + Clip = 1, + Trailer = 2, + BehindTheScenes = 3, + DeletedScene = 4, + Interview = 5, + Scene = 6, + Sample = 7, + ThemeSong = 8, + ThemeVideo = 9 + } +} diff --git a/MediaBrowser.Model/Entities/IHasProviderIds.cs b/MediaBrowser.Model/Entities/IHasProviderIds.cs new file mode 100644 index 000000000..796850dbd --- /dev/null +++ b/MediaBrowser.Model/Entities/IHasProviderIds.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; + +namespace MediaBrowser.Model.Entities +{ + /// <summary> + /// Since BaseItem and DTOBaseItem both have ProviderIds, this interface helps avoid code repition by using extension methods + /// </summary> + public interface IHasProviderIds + { + /// <summary> + /// Gets or sets the provider ids. + /// </summary> + /// <value>The provider ids.</value> + Dictionary<string, string> ProviderIds { get; set; } + } +} diff --git a/MediaBrowser.Model/Entities/ImageType.cs b/MediaBrowser.Model/Entities/ImageType.cs new file mode 100644 index 000000000..6e0ba717f --- /dev/null +++ b/MediaBrowser.Model/Entities/ImageType.cs @@ -0,0 +1,58 @@ + +namespace MediaBrowser.Model.Entities +{ + /// <summary> + /// Enum ImageType + /// </summary> + public enum ImageType + { + /// <summary> + /// The primary + /// </summary> + Primary = 0, + /// <summary> + /// The art + /// </summary> + Art = 1, + /// <summary> + /// The backdrop + /// </summary> + Backdrop = 2, + /// <summary> + /// The banner + /// </summary> + Banner = 3, + /// <summary> + /// The logo + /// </summary> + Logo = 4, + /// <summary> + /// The thumb + /// </summary> + Thumb = 5, + /// <summary> + /// The disc + /// </summary> + Disc = 6, + /// <summary> + /// The box + /// </summary> + Box = 7, + /// <summary> + /// The screenshot + /// </summary> + Screenshot = 8, + /// <summary> + /// The menu + /// </summary> + Menu = 9, + /// <summary> + /// The chapter image + /// </summary> + Chapter = 10, + /// <summary> + /// The box rear + /// </summary> + BoxRear = 11 + } +} diff --git a/MediaBrowser.Model/Entities/IsoType.cs b/MediaBrowser.Model/Entities/IsoType.cs new file mode 100644 index 000000000..567b98ab9 --- /dev/null +++ b/MediaBrowser.Model/Entities/IsoType.cs @@ -0,0 +1,17 @@ +namespace MediaBrowser.Model.Entities +{ + /// <summary> + /// Enum IsoType + /// </summary> + public enum IsoType + { + /// <summary> + /// The DVD + /// </summary> + Dvd, + /// <summary> + /// The blu ray + /// </summary> + BluRay + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Entities/LibraryUpdateInfo.cs b/MediaBrowser.Model/Entities/LibraryUpdateInfo.cs new file mode 100644 index 000000000..dfab9add2 --- /dev/null +++ b/MediaBrowser.Model/Entities/LibraryUpdateInfo.cs @@ -0,0 +1,62 @@ +using System; + +namespace MediaBrowser.Model.Entities +{ + /// <summary> + /// Class LibraryUpdateInfo + /// </summary> + public class LibraryUpdateInfo + { + /// <summary> + /// Gets or sets the folders added to. + /// </summary> + /// <value>The folders added to.</value> + public string[] FoldersAddedTo { get; set; } + /// <summary> + /// Gets or sets the folders removed from. + /// </summary> + /// <value>The folders removed from.</value> + public string[] FoldersRemovedFrom { get; set; } + + /// <summary> + /// Gets or sets the items added. + /// </summary> + /// <value>The items added.</value> + public string[] ItemsAdded { get; set; } + + /// <summary> + /// Gets or sets the items removed. + /// </summary> + /// <value>The items removed.</value> + public string[] ItemsRemoved { get; set; } + + /// <summary> + /// Gets or sets the items updated. + /// </summary> + /// <value>The items updated.</value> + public string[] ItemsUpdated { get; set; } + + public string[] CollectionFolders { get; set; } + + public bool IsEmpty + { + get + { + return FoldersAddedTo.Length == 0 && FoldersRemovedFrom.Length == 0 && ItemsAdded.Length == 0 && ItemsRemoved.Length == 0 && ItemsUpdated.Length == 0 && CollectionFolders.Length == 0; + } + } + + /// <summary> + /// Initializes a new instance of the <see cref="LibraryUpdateInfo"/> class. + /// </summary> + public LibraryUpdateInfo() + { + FoldersAddedTo = new string[] { }; + FoldersRemovedFrom = new string[] { }; + ItemsAdded = new string[] { }; + ItemsRemoved = new string[] { }; + ItemsUpdated = new string[] { }; + CollectionFolders = new string[] { }; + } + } +} diff --git a/MediaBrowser.Model/Entities/LocationType.cs b/MediaBrowser.Model/Entities/LocationType.cs new file mode 100644 index 000000000..84de803aa --- /dev/null +++ b/MediaBrowser.Model/Entities/LocationType.cs @@ -0,0 +1,26 @@ + +namespace MediaBrowser.Model.Entities +{ + /// <summary> + /// Enum LocationType + /// </summary> + public enum LocationType + { + /// <summary> + /// The file system + /// </summary> + FileSystem = 0, + /// <summary> + /// The remote + /// </summary> + Remote = 1, + /// <summary> + /// The virtual + /// </summary> + Virtual = 2, + /// <summary> + /// The offline + /// </summary> + Offline = 3 + } +} diff --git a/MediaBrowser.Model/Entities/MBRegistrationRecord.cs b/MediaBrowser.Model/Entities/MBRegistrationRecord.cs new file mode 100644 index 000000000..00176fb34 --- /dev/null +++ b/MediaBrowser.Model/Entities/MBRegistrationRecord.cs @@ -0,0 +1,14 @@ +using System; + +namespace MediaBrowser.Model.Entities +{ + public class MBRegistrationRecord + { + public DateTime ExpirationDate { get; set; } + public bool IsRegistered { get; set; } + public bool RegChecked { get; set; } + public bool RegError { get; set; } + public bool TrialVersion { get; set; } + public bool IsValid { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs new file mode 100644 index 000000000..fc208459d --- /dev/null +++ b/MediaBrowser.Model/Entities/MediaStream.cs @@ -0,0 +1,475 @@ +using System; +using System.Collections.Generic; +using MediaBrowser.Model.Dlna; +using MediaBrowser.Model.Extensions; +using MediaBrowser.Model.MediaInfo; +using System.Globalization; + +namespace MediaBrowser.Model.Entities +{ + /// <summary> + /// Class MediaStream + /// </summary> + public class MediaStream + { + /// <summary> + /// Gets or sets the codec. + /// </summary> + /// <value>The codec.</value> + public string Codec { get; set; } + + /// <summary> + /// Gets or sets the codec tag. + /// </summary> + /// <value>The codec tag.</value> + public string CodecTag { get; set; } + + /// <summary> + /// Gets or sets the language. + /// </summary> + /// <value>The language.</value> + public string Language { get; set; } + + public string ColorTransfer { get; set; } + public string ColorPrimaries { get; set; } + public string ColorSpace { get; set; } + + /// <summary> + /// Gets or sets the comment. + /// </summary> + /// <value>The comment.</value> + public string Comment { get; set; } + + public string TimeBase { get; set; } + public string CodecTimeBase { get; set; } + + public string Title { get; set; } + + public string VideoRange + { + get + { + if (Type != MediaStreamType.Video) + { + return null; + } + + var colorTransfer = ColorTransfer; + + if (string.Equals(colorTransfer, "smpte2084", StringComparison.OrdinalIgnoreCase)) + { + return "HDR"; + } + + return "SDR"; + } + } + + public string DisplayTitle + { + get + { + if (Type == MediaStreamType.Audio) + { + //if (!string.IsNullOrEmpty(Title)) + //{ + // return AddLanguageIfNeeded(Title); + //} + + List<string> attributes = new List<string>(); + + if (!string.IsNullOrEmpty(Language)) + { + attributes.Add(StringHelper.FirstToUpper(Language)); + } + if (!string.IsNullOrEmpty(Codec) && !StringHelper.EqualsIgnoreCase(Codec, "dca")) + { + attributes.Add(AudioCodec.GetFriendlyName(Codec)); + } + else if (!string.IsNullOrEmpty(Profile) && !StringHelper.EqualsIgnoreCase(Profile, "lc")) + { + attributes.Add(Profile); + } + + if (!string.IsNullOrEmpty(ChannelLayout)) + { + attributes.Add(ChannelLayout); + } + else if (Channels.HasValue) + { + attributes.Add(Channels.Value.ToString(CultureInfo.InvariantCulture) + " ch"); + } + if (IsDefault) + { + attributes.Add("Default"); + } + + return string.Join(" ", attributes.ToArray(attributes.Count)); + } + + if (Type == MediaStreamType.Video) + { + List<string> attributes = new List<string>(); + + var resolutionText = GetResolutionText(); + + if (!string.IsNullOrEmpty(resolutionText)) + { + attributes.Add(resolutionText); + } + + if (!string.IsNullOrEmpty(Codec)) + { + attributes.Add(Codec.ToUpper()); + } + + return string.Join(" ", attributes.ToArray(attributes.Count)); + } + + if (Type == MediaStreamType.Subtitle) + { + //if (!string.IsNullOrEmpty(Title)) + //{ + // return AddLanguageIfNeeded(Title); + //} + + List<string> attributes = new List<string>(); + + if (!string.IsNullOrEmpty(Language)) + { + attributes.Add(StringHelper.FirstToUpper(Language)); + } + else + { + attributes.Add("Und"); + } + + if (IsDefault) + { + attributes.Add("Default"); + } + + if (IsForced) + { + attributes.Add("Forced"); + } + + string name = string.Join(" ", attributes.ToArray(attributes.Count)); + + return name; + } + + if (Type == MediaStreamType.Video) + { + + } + + return null; + } + } + + private string GetResolutionText() + { + var i = this; + + if (i.Width.HasValue && i.Height.HasValue) + { + var width = i.Width.Value; + var height = i.Height.Value; + + if (width >= 3800 || height >= 2000) + { + return "4K"; + } + if (width >= 2500) + { + if (i.IsInterlaced) + { + return "1440I"; + } + return "1440P"; + } + if (width >= 1900 || height >= 1000) + { + if (i.IsInterlaced) + { + return "1080I"; + } + return "1080P"; + } + if (width >= 1260 || height >= 700) + { + if (i.IsInterlaced) + { + return "720I"; + } + return "720P"; + } + if (width >= 700 || height >= 440) + { + + if (i.IsInterlaced) + { + return "480I"; + } + return "480P"; + } + + return "SD"; + } + return null; + } + + private string AddLanguageIfNeeded(string title) + { + if (!string.IsNullOrEmpty(Language) && + !string.Equals(Language, "und", StringComparison.OrdinalIgnoreCase) && + !IsLanguageInTitle(title, Language)) + { + title = StringHelper.FirstToUpper(Language) + " " + title; + } + + return title; + } + + private bool IsLanguageInTitle(string title, string language) + { + if (title.IndexOf(Language, StringComparison.OrdinalIgnoreCase) != -1) + { + return true; + } + + return false; + } + + public string NalLengthSize { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether this instance is interlaced. + /// </summary> + /// <value><c>true</c> if this instance is interlaced; otherwise, <c>false</c>.</value> + public bool IsInterlaced { get; set; } + + public bool? IsAVC { get; set; } + + /// <summary> + /// Gets or sets the channel layout. + /// </summary> + /// <value>The channel layout.</value> + public string ChannelLayout { get; set; } + + /// <summary> + /// Gets or sets the bit rate. + /// </summary> + /// <value>The bit rate.</value> + public int? BitRate { get; set; } + + /// <summary> + /// Gets or sets the bit depth. + /// </summary> + /// <value>The bit depth.</value> + public int? BitDepth { get; set; } + + /// <summary> + /// Gets or sets the reference frames. + /// </summary> + /// <value>The reference frames.</value> + public int? RefFrames { get; set; } + + /// <summary> + /// Gets or sets the length of the packet. + /// </summary> + /// <value>The length of the packet.</value> + public int? PacketLength { get; set; } + + /// <summary> + /// Gets or sets the channels. + /// </summary> + /// <value>The channels.</value> + public int? Channels { get; set; } + + /// <summary> + /// Gets or sets the sample rate. + /// </summary> + /// <value>The sample rate.</value> + public int? SampleRate { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether this instance is default. + /// </summary> + /// <value><c>true</c> if this instance is default; otherwise, <c>false</c>.</value> + public bool IsDefault { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether this instance is forced. + /// </summary> + /// <value><c>true</c> if this instance is forced; otherwise, <c>false</c>.</value> + public bool IsForced { get; set; } + + /// <summary> + /// Gets or sets the height. + /// </summary> + /// <value>The height.</value> + public int? Height { get; set; } + + /// <summary> + /// Gets or sets the width. + /// </summary> + /// <value>The width.</value> + public int? Width { get; set; } + + /// <summary> + /// Gets or sets the average frame rate. + /// </summary> + /// <value>The average frame rate.</value> + public float? AverageFrameRate { get; set; } + + /// <summary> + /// Gets or sets the real frame rate. + /// </summary> + /// <value>The real frame rate.</value> + public float? RealFrameRate { get; set; } + + /// <summary> + /// Gets or sets the profile. + /// </summary> + /// <value>The profile.</value> + public string Profile { get; set; } + + /// <summary> + /// Gets or sets the type. + /// </summary> + /// <value>The type.</value> + public MediaStreamType Type { get; set; } + + /// <summary> + /// Gets or sets the aspect ratio. + /// </summary> + /// <value>The aspect ratio.</value> + public string AspectRatio { get; set; } + + /// <summary> + /// Gets or sets the index. + /// </summary> + /// <value>The index.</value> + public int Index { get; set; } + + /// <summary> + /// Gets or sets the score. + /// </summary> + /// <value>The score.</value> + public int? Score { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether this instance is external. + /// </summary> + /// <value><c>true</c> if this instance is external; otherwise, <c>false</c>.</value> + public bool IsExternal { get; set; } + + /// <summary> + /// Gets or sets the method. + /// </summary> + /// <value>The method.</value> + public SubtitleDeliveryMethod? DeliveryMethod { get; set; } + /// <summary> + /// Gets or sets the delivery URL. + /// </summary> + /// <value>The delivery URL.</value> + public string DeliveryUrl { get; set; } + /// <summary> + /// Gets or sets a value indicating whether this instance is external URL. + /// </summary> + /// <value><c>null</c> if [is external URL] contains no value, <c>true</c> if [is external URL]; otherwise, <c>false</c>.</value> + public bool? IsExternalUrl { get; set; } + + public bool IsTextSubtitleStream + { + get + { + if (Type != MediaStreamType.Subtitle) return false; + + if (string.IsNullOrEmpty(Codec) && !IsExternal) + { + return false; + } + + return IsTextFormat(Codec); + } + } + + public static bool IsTextFormat(string format) + { + string codec = format ?? string.Empty; + + // sub = external .sub file + + return codec.IndexOf("pgs", StringComparison.OrdinalIgnoreCase) == -1 && + codec.IndexOf("dvd", StringComparison.OrdinalIgnoreCase) == -1 && + codec.IndexOf("dvbsub", StringComparison.OrdinalIgnoreCase) == -1 && + !StringHelper.EqualsIgnoreCase(codec, "sub") && + !StringHelper.EqualsIgnoreCase(codec, "dvb_subtitle"); + } + + public bool SupportsSubtitleConversionTo(string toCodec) + { + if (!IsTextSubtitleStream) + { + return false; + } + + var fromCodec = Codec; + + // Can't convert from this + if (StringHelper.EqualsIgnoreCase(fromCodec, "ass")) + { + return false; + } + if (StringHelper.EqualsIgnoreCase(fromCodec, "ssa")) + { + return false; + } + + // Can't convert to this + if (StringHelper.EqualsIgnoreCase(toCodec, "ass")) + { + return false; + } + if (StringHelper.EqualsIgnoreCase(toCodec, "ssa")) + { + return false; + } + + return true; + } + + /// <summary> + /// Gets or sets a value indicating whether [supports external stream]. + /// </summary> + /// <value><c>true</c> if [supports external stream]; otherwise, <c>false</c>.</value> + public bool SupportsExternalStream { get; set; } + + /// <summary> + /// Gets or sets the filename. + /// </summary> + /// <value>The filename.</value> + public string Path { get; set; } + + /// <summary> + /// Gets or sets the pixel format. + /// </summary> + /// <value>The pixel format.</value> + public string PixelFormat { get; set; } + + /// <summary> + /// Gets or sets the level. + /// </summary> + /// <value>The level.</value> + public double? Level { get; set; } + + /// <summary> + /// Gets a value indicating whether this instance is anamorphic. + /// </summary> + /// <value><c>true</c> if this instance is anamorphic; otherwise, <c>false</c>.</value> + public bool? IsAnamorphic { get; set; } + } +} diff --git a/MediaBrowser.Model/Entities/MediaStreamType.cs b/MediaBrowser.Model/Entities/MediaStreamType.cs new file mode 100644 index 000000000..084a411f9 --- /dev/null +++ b/MediaBrowser.Model/Entities/MediaStreamType.cs @@ -0,0 +1,25 @@ +namespace MediaBrowser.Model.Entities +{ + /// <summary> + /// Enum MediaStreamType + /// </summary> + public enum MediaStreamType + { + /// <summary> + /// The audio + /// </summary> + Audio, + /// <summary> + /// The video + /// </summary> + Video, + /// <summary> + /// The subtitle + /// </summary> + Subtitle, + /// <summary> + /// The embedded image + /// </summary> + EmbeddedImage + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Entities/MediaType.cs b/MediaBrowser.Model/Entities/MediaType.cs new file mode 100644 index 000000000..0c9bde6fb --- /dev/null +++ b/MediaBrowser.Model/Entities/MediaType.cs @@ -0,0 +1,30 @@ + +namespace MediaBrowser.Model.Entities +{ + /// <summary> + /// Class MediaType + /// </summary> + public class MediaType + { + /// <summary> + /// The video + /// </summary> + public const string Video = "Video"; + /// <summary> + /// The audio + /// </summary> + public const string Audio = "Audio"; + /// <summary> + /// The game + /// </summary> + public const string Game = "Game"; + /// <summary> + /// The photo + /// </summary> + public const string Photo = "Photo"; + /// <summary> + /// The book + /// </summary> + public const string Book = "Book"; + } +} diff --git a/MediaBrowser.Model/Entities/MediaUrl.cs b/MediaBrowser.Model/Entities/MediaUrl.cs new file mode 100644 index 000000000..2e17bba8a --- /dev/null +++ b/MediaBrowser.Model/Entities/MediaUrl.cs @@ -0,0 +1,9 @@ + +namespace MediaBrowser.Model.Entities +{ + public class MediaUrl + { + public string Url { get; set; } + public string Name { get; set; } + } +} diff --git a/MediaBrowser.Model/Entities/MetadataFields.cs b/MediaBrowser.Model/Entities/MetadataFields.cs new file mode 100644 index 000000000..85f2da31e --- /dev/null +++ b/MediaBrowser.Model/Entities/MetadataFields.cs @@ -0,0 +1,46 @@ + +namespace MediaBrowser.Model.Entities +{ + /// <summary> + /// Enum MetadataFields + /// </summary> + public enum MetadataFields + { + /// <summary> + /// The cast + /// </summary> + Cast, + /// <summary> + /// The genres + /// </summary> + Genres, + /// <summary> + /// The production locations + /// </summary> + ProductionLocations, + /// <summary> + /// The studios + /// </summary> + Studios, + /// <summary> + /// The tags + /// </summary> + Tags, + /// <summary> + /// The name + /// </summary> + Name, + /// <summary> + /// The overview + /// </summary> + Overview, + /// <summary> + /// The runtime + /// </summary> + Runtime, + /// <summary> + /// The official rating + /// </summary> + OfficialRating + } +} diff --git a/MediaBrowser.Model/Entities/MetadataProviders.cs b/MediaBrowser.Model/Entities/MetadataProviders.cs new file mode 100644 index 000000000..efd4339d5 --- /dev/null +++ b/MediaBrowser.Model/Entities/MetadataProviders.cs @@ -0,0 +1,41 @@ + +namespace MediaBrowser.Model.Entities +{ + /// <summary> + /// Enum MetadataProviders + /// </summary> + public enum MetadataProviders + { + Gamesdb = 1, + /// <summary> + /// The imdb + /// </summary> + Imdb = 2, + /// <summary> + /// The TMDB + /// </summary> + Tmdb = 3, + /// <summary> + /// The TVDB + /// </summary> + Tvdb = 4, + /// <summary> + /// The tvcom + /// </summary> + Tvcom = 5, + /// <summary> + /// Tmdb Collection Id + /// </summary> + TmdbCollection = 7, + MusicBrainzAlbum = 8, + MusicBrainzAlbumArtist = 9, + MusicBrainzArtist = 10, + MusicBrainzReleaseGroup = 11, + Zap2It = 12, + TvRage = 15, + AudioDbArtist = 16, + AudioDbAlbum = 17, + MusicBrainzTrack = 18, + TvMaze = 19 + } +} diff --git a/MediaBrowser.Model/Entities/PackageReviewInfo.cs b/MediaBrowser.Model/Entities/PackageReviewInfo.cs new file mode 100644 index 000000000..52500a41e --- /dev/null +++ b/MediaBrowser.Model/Entities/PackageReviewInfo.cs @@ -0,0 +1,38 @@ +using System; + +namespace MediaBrowser.Model.Entities +{ + public class PackageReviewInfo + { + /// <summary> + /// The package id (database key) for this review + /// </summary> + public int id { get; set; } + + /// <summary> + /// The rating value + /// </summary> + public int rating { get; set; } + + /// <summary> + /// Whether or not this review recommends this item + /// </summary> + public bool recommend { get; set; } + + /// <summary> + /// A short description of the review + /// </summary> + public string title { get; set; } + + /// <summary> + /// A full review + /// </summary> + public string review { get; set; } + + /// <summary> + /// Time of review + /// </summary> + public DateTime timestamp { get; set; } + + } +} diff --git a/MediaBrowser.Model/Entities/ParentalRating.cs b/MediaBrowser.Model/Entities/ParentalRating.cs new file mode 100644 index 000000000..302c1e299 --- /dev/null +++ b/MediaBrowser.Model/Entities/ParentalRating.cs @@ -0,0 +1,32 @@ + +namespace MediaBrowser.Model.Entities +{ + /// <summary> + /// Class ParentalRating + /// </summary> + public class ParentalRating + { + /// <summary> + /// Gets or sets the name. + /// </summary> + /// <value>The name.</value> + public string Name { get; set; } + + /// <summary> + /// Gets or sets the value. + /// </summary> + /// <value>The value.</value> + public int Value { get; set; } + + public ParentalRating() + { + + } + + public ParentalRating(string name, int value) + { + Name = name; + Value = value; + } + } +} diff --git a/MediaBrowser.Model/Entities/PersonType.cs b/MediaBrowser.Model/Entities/PersonType.cs new file mode 100644 index 000000000..bc274972d --- /dev/null +++ b/MediaBrowser.Model/Entities/PersonType.cs @@ -0,0 +1,42 @@ + +namespace MediaBrowser.Model.Entities +{ + /// <summary> + /// Struct PersonType + /// </summary> + public class PersonType + { + /// <summary> + /// The actor + /// </summary> + public const string Actor = "Actor"; + /// <summary> + /// The director + /// </summary> + public const string Director = "Director"; + /// <summary> + /// The composer + /// </summary> + public const string Composer = "Composer"; + /// <summary> + /// The writer + /// </summary> + public const string Writer = "Writer"; + /// <summary> + /// The guest star + /// </summary> + public const string GuestStar = "GuestStar"; + /// <summary> + /// The producer + /// </summary> + public const string Producer = "Producer"; + /// <summary> + /// The conductor + /// </summary> + public const string Conductor = "Conductor"; + /// <summary> + /// The lyricist + /// </summary> + public const string Lyricist = "Lyricist"; + } +} diff --git a/MediaBrowser.Model/Entities/PluginSecurityInfo.cs b/MediaBrowser.Model/Entities/PluginSecurityInfo.cs new file mode 100644 index 000000000..5cab55013 --- /dev/null +++ b/MediaBrowser.Model/Entities/PluginSecurityInfo.cs @@ -0,0 +1,21 @@ + +namespace MediaBrowser.Model.Entities +{ + /// <summary> + /// Class PluginSecurityInfo + /// </summary> + public class PluginSecurityInfo + { + /// <summary> + /// Gets or sets the supporter key. + /// </summary> + /// <value>The supporter key.</value> + public string SupporterKey { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether this instance is MB supporter. + /// </summary> + /// <value><c>true</c> if this instance is MB supporter; otherwise, <c>false</c>.</value> + public bool IsMBSupporter { get; set; } + } +} diff --git a/MediaBrowser.Model/Entities/ProviderIdsExtensions.cs b/MediaBrowser.Model/Entities/ProviderIdsExtensions.cs new file mode 100644 index 000000000..e10232baa --- /dev/null +++ b/MediaBrowser.Model/Entities/ProviderIdsExtensions.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; + +namespace MediaBrowser.Model.Entities +{ + /// <summary> + /// Class ProviderIdsExtensions + /// </summary> + public static class ProviderIdsExtensions + { + /// <summary> + /// Determines whether [has provider identifier] [the specified instance]. + /// </summary> + /// <param name="instance">The instance.</param> + /// <param name="provider">The provider.</param> + /// <returns><c>true</c> if [has provider identifier] [the specified instance]; otherwise, <c>false</c>.</returns> + public static bool HasProviderId(this IHasProviderIds instance, MetadataProviders provider) + { + return !string.IsNullOrEmpty(instance.GetProviderId(provider.ToString())); + } + + /// <summary> + /// Gets a provider id + /// </summary> + /// <param name="instance">The instance.</param> + /// <param name="provider">The provider.</param> + /// <returns>System.String.</returns> + public static string GetProviderId(this IHasProviderIds instance, MetadataProviders provider) + { + return instance.GetProviderId(provider.ToString()); + } + + /// <summary> + /// Gets a provider id + /// </summary> + /// <param name="instance">The instance.</param> + /// <param name="name">The name.</param> + /// <returns>System.String.</returns> + public static string GetProviderId(this IHasProviderIds instance, string name) + { + if (instance == null) + { + throw new ArgumentNullException("instance"); + } + + if (instance.ProviderIds == null) + { + return null; + } + + string id; + instance.ProviderIds.TryGetValue(name, out id); + return id; + } + + /// <summary> + /// Sets a provider id + /// </summary> + /// <param name="instance">The instance.</param> + /// <param name="name">The name.</param> + /// <param name="value">The value.</param> + public static void SetProviderId(this IHasProviderIds instance, string name, string value) + { + if (instance == null) + { + throw new ArgumentNullException("instance"); + } + + // If it's null remove the key from the dictionary + if (string.IsNullOrEmpty(value)) + { + if (instance.ProviderIds != null) + { + if (instance.ProviderIds.ContainsKey(name)) + { + instance.ProviderIds.Remove(name); + } + } + } + else + { + // Ensure it exists + if (instance.ProviderIds == null) + { + instance.ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); + } + + instance.ProviderIds[name] = value; + } + } + + /// <summary> + /// Sets a provider id + /// </summary> + /// <param name="instance">The instance.</param> + /// <param name="provider">The provider.</param> + /// <param name="value">The value.</param> + public static void SetProviderId(this IHasProviderIds instance, MetadataProviders provider, string value) + { + instance.SetProviderId(provider.ToString(), value); + } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Entities/ScrollDirection.cs b/MediaBrowser.Model/Entities/ScrollDirection.cs new file mode 100644 index 000000000..ed2210300 --- /dev/null +++ b/MediaBrowser.Model/Entities/ScrollDirection.cs @@ -0,0 +1,17 @@ +namespace MediaBrowser.Model.Entities +{ + /// <summary> + /// Enum ScrollDirection + /// </summary> + public enum ScrollDirection + { + /// <summary> + /// The horizontal + /// </summary> + Horizontal, + /// <summary> + /// The vertical + /// </summary> + Vertical + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Entities/SeriesStatus.cs b/MediaBrowser.Model/Entities/SeriesStatus.cs new file mode 100644 index 000000000..d04a2856c --- /dev/null +++ b/MediaBrowser.Model/Entities/SeriesStatus.cs @@ -0,0 +1,18 @@ + +namespace MediaBrowser.Model.Entities +{ + /// <summary> + /// Enum SeriesStatus + /// </summary> + public enum SeriesStatus + { + /// <summary> + /// The continuing + /// </summary> + Continuing, + /// <summary> + /// The ended + /// </summary> + Ended + } +} diff --git a/MediaBrowser.Model/Entities/SortOrder.cs b/MediaBrowser.Model/Entities/SortOrder.cs new file mode 100644 index 000000000..5130449ba --- /dev/null +++ b/MediaBrowser.Model/Entities/SortOrder.cs @@ -0,0 +1,17 @@ +namespace MediaBrowser.Model.Entities +{ + /// <summary> + /// Enum SortOrder + /// </summary> + public enum SortOrder + { + /// <summary> + /// The ascending + /// </summary> + Ascending, + /// <summary> + /// The descending + /// </summary> + Descending + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Entities/TrailerType.cs b/MediaBrowser.Model/Entities/TrailerType.cs new file mode 100644 index 000000000..085f461cf --- /dev/null +++ b/MediaBrowser.Model/Entities/TrailerType.cs @@ -0,0 +1,11 @@ +namespace MediaBrowser.Model.Entities +{ + public enum TrailerType + { + ComingSoonToTheaters = 1, + ComingSoonToDvd = 2, + ComingSoonToStreaming = 3, + Archive = 4, + LocalTrailer = 5 + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Entities/UserDataSaveReason.cs b/MediaBrowser.Model/Entities/UserDataSaveReason.cs new file mode 100644 index 000000000..d9691f395 --- /dev/null +++ b/MediaBrowser.Model/Entities/UserDataSaveReason.cs @@ -0,0 +1,34 @@ + +namespace MediaBrowser.Model.Entities +{ + /// <summary> + /// Enum UserDataSaveReason + /// </summary> + public enum UserDataSaveReason + { + /// <summary> + /// The playback start + /// </summary> + PlaybackStart = 1, + /// <summary> + /// The playback progress + /// </summary> + PlaybackProgress = 2, + /// <summary> + /// The playback finished + /// </summary> + PlaybackFinished = 3, + /// <summary> + /// The toggle played + /// </summary> + TogglePlayed = 4, + /// <summary> + /// The update user rating + /// </summary> + UpdateUserRating = 5, + /// <summary> + /// The import + /// </summary> + Import = 6 + } +} diff --git a/MediaBrowser.Model/Entities/Video3DFormat.cs b/MediaBrowser.Model/Entities/Video3DFormat.cs new file mode 100644 index 000000000..722df4281 --- /dev/null +++ b/MediaBrowser.Model/Entities/Video3DFormat.cs @@ -0,0 +1,12 @@ + +namespace MediaBrowser.Model.Entities +{ + public enum Video3DFormat + { + HalfSideBySide, + FullSideBySide, + FullTopAndBottom, + HalfTopAndBottom, + MVC + } +} diff --git a/MediaBrowser.Model/Entities/VideoType.cs b/MediaBrowser.Model/Entities/VideoType.cs new file mode 100644 index 000000000..05c2fa32c --- /dev/null +++ b/MediaBrowser.Model/Entities/VideoType.cs @@ -0,0 +1,26 @@ + +namespace MediaBrowser.Model.Entities +{ + /// <summary> + /// Enum VideoType + /// </summary> + public enum VideoType + { + /// <summary> + /// The video file + /// </summary> + VideoFile, + /// <summary> + /// The iso + /// </summary> + Iso, + /// <summary> + /// The DVD + /// </summary> + Dvd, + /// <summary> + /// The blu ray + /// </summary> + BluRay + } +} diff --git a/MediaBrowser.Model/Entities/VirtualFolderInfo.cs b/MediaBrowser.Model/Entities/VirtualFolderInfo.cs new file mode 100644 index 000000000..68f713295 --- /dev/null +++ b/MediaBrowser.Model/Entities/VirtualFolderInfo.cs @@ -0,0 +1,55 @@ +using System.Collections.Generic; +using MediaBrowser.Model.Configuration; +using System; + +namespace MediaBrowser.Model.Entities +{ + /// <summary> + /// Used to hold information about a user's list of configured virtual folders + /// </summary> + public class VirtualFolderInfo + { + /// <summary> + /// Gets or sets the name. + /// </summary> + /// <value>The name.</value> + public string Name { get; set; } + + /// <summary> + /// Gets or sets the locations. + /// </summary> + /// <value>The locations.</value> + public string[] Locations { get; set; } + + /// <summary> + /// Gets or sets the type of the collection. + /// </summary> + /// <value>The type of the collection.</value> + public string CollectionType { get; set; } + + public LibraryOptions LibraryOptions { get; set; } + + /// <summary> + /// Initializes a new instance of the <see cref="VirtualFolderInfo"/> class. + /// </summary> + public VirtualFolderInfo() + { + Locations = new string[] {}; + } + + /// <summary> + /// Gets or sets the item identifier. + /// </summary> + /// <value>The item identifier.</value> + public string ItemId { get; set; } + + /// <summary> + /// Gets or sets the primary image item identifier. + /// </summary> + /// <value>The primary image item identifier.</value> + public string PrimaryImageItemId { get; set; } + + public double? RefreshProgress { get; set; } + public string RefreshStatus { get; set; } + } +} |
