diff options
| author | LukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com> | 2012-09-10 21:34:02 -0400 |
|---|---|---|
| committer | LukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com> | 2012-09-10 21:34:02 -0400 |
| commit | 2467ca966823d78737a268d2c3b3730bc3b286cc (patch) | |
| tree | b9f2d9a1c84d56ea11ddf66e5bf508a151102c9d /MediaBrowser.Controller | |
| parent | b1df61f7cededfdea119e98296f74e1313e4ffe3 (diff) | |
Moved some entities to the main project
Diffstat (limited to 'MediaBrowser.Controller')
45 files changed, 856 insertions, 62 deletions
diff --git a/MediaBrowser.Controller/Entities/Audio.cs b/MediaBrowser.Controller/Entities/Audio.cs new file mode 100644 index 0000000000..61e901dd22 --- /dev/null +++ b/MediaBrowser.Controller/Entities/Audio.cs @@ -0,0 +1,14 @@ +
+namespace MediaBrowser.Controller.Entities
+{
+ public class Audio : BaseItem
+ {
+ public int BitRate { get; set; }
+ public int Channels { get; set; }
+ public int SampleRate { get; set; }
+
+ public string Artist { get; set; }
+ public string Album { get; set; }
+ public string AlbumArtist { get; set; }
+ }
+}
diff --git a/MediaBrowser.Controller/Entities/BaseEntity.cs b/MediaBrowser.Controller/Entities/BaseEntity.cs new file mode 100644 index 0000000000..53b42da01d --- /dev/null +++ b/MediaBrowser.Controller/Entities/BaseEntity.cs @@ -0,0 +1,25 @@ +using System;
+
+namespace MediaBrowser.Controller.Entities
+{
+ /// <summary>
+ /// Provides a base entity for all of our types
+ /// </summary>
+ public abstract class BaseEntity
+ {
+ public string Name { get; set; }
+
+ public Guid Id { get; set; }
+
+ public string PrimaryImagePath { get; set; }
+
+ public DateTime DateCreated { get; set; }
+
+ public DateTime DateModified { get; set; }
+
+ public override string ToString()
+ {
+ return Name;
+ }
+ }
+}
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs new file mode 100644 index 0000000000..68a192065f --- /dev/null +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -0,0 +1,173 @@ +using MediaBrowser.Model.Entities;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace MediaBrowser.Controller.Entities
+{
+ public abstract class BaseItem : BaseEntity, IHasProviderIds
+ {
+ public string SortName { get; set; }
+
+ /// <summary>
+ /// When the item first debuted. For movies this could be premiere date, episodes would be first aired
+ /// </summary>
+ public DateTime? PremiereDate { get; set; }
+
+ public string Path { get; set; }
+
+ public Folder Parent { get; set; }
+
+ public string LogoImagePath { get; set; }
+
+ public string ArtImagePath { get; set; }
+
+ public string ThumbnailImagePath { get; set; }
+
+ public string BannerImagePath { get; set; }
+
+ public IEnumerable<string> BackdropImagePaths { get; set; }
+
+ public string OfficialRating { get; set; }
+
+ public string CustomRating { get; set; }
+ public string CustomPin { get; set; }
+
+ public string Language { get; set; }
+ public string Overview { get; set; }
+ public List<string> Taglines { get; set; }
+
+ /// <summary>
+ /// Using a Dictionary to prevent duplicates
+ /// </summary>
+ public Dictionary<string,PersonInfo> People { get; set; }
+
+ public List<string> Studios { get; set; }
+
+ public List<string> Genres { get; set; }
+
+ public string DisplayMediaType { get; set; }
+
+ public float? UserRating { get; set; }
+ public long? RunTimeTicks { get; set; }
+
+ public string AspectRatio { get; set; }
+ public int? ProductionYear { get; set; }
+
+ /// <summary>
+ /// If the item is part of a series, this is it's number in the series.
+ /// This could be episode number, album track number, etc.
+ /// </summary>
+ public int? IndexNumber { get; set; }
+
+ /// <summary>
+ /// For an episode this could be the season number, or for a song this could be the disc number.
+ /// </summary>
+ public int? ParentIndexNumber { get; set; }
+
+ public IEnumerable<Video> LocalTrailers { get; set; }
+
+ public string TrailerUrl { get; set; }
+
+ public Dictionary<string, string> ProviderIds { get; set; }
+
+ public Dictionary<Guid, UserItemData> UserData { get; set; }
+
+ public UserItemData GetUserData(User user, bool createIfNull)
+ {
+ if (UserData == null || !UserData.ContainsKey(user.Id))
+ {
+ if (createIfNull)
+ {
+ AddUserData(user, new UserItemData());
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ return UserData[user.Id];
+ }
+
+ private void AddUserData(User user, UserItemData data)
+ {
+ if (UserData == null)
+ {
+ UserData = new Dictionary<Guid, UserItemData>();
+ }
+
+ UserData[user.Id] = data;
+ }
+
+ /// <summary>
+ /// Determines if a given user has access to this item
+ /// </summary>
+ internal bool IsParentalAllowed(User user)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Finds an item by ID, recursively
+ /// </summary>
+ public virtual BaseItem FindItemById(Guid id)
+ {
+ if (Id == id)
+ {
+ return this;
+ }
+
+ if (LocalTrailers != null)
+ {
+ return LocalTrailers.FirstOrDefault(i => i.Id == id);
+ }
+
+ return null;
+ }
+
+ public virtual bool IsFolder
+ {
+ get
+ {
+ return false;
+ }
+ }
+
+ /// <summary>
+ /// Determines if the item is considered new based on user settings
+ /// </summary>
+ public bool IsRecentlyAdded(User user)
+ {
+ return (DateTime.UtcNow - DateCreated).TotalDays < user.RecentItemDays;
+ }
+
+ public void AddPerson(PersonInfo person)
+ {
+ if (People == null)
+ {
+ People = new Dictionary<string, PersonInfo>(StringComparer.OrdinalIgnoreCase);
+ }
+
+ People[person.Name] = person;
+ }
+
+ /// <summary>
+ /// Marks the item as either played or unplayed
+ /// </summary>
+ public virtual void SetPlayedStatus(User user, bool wasPlayed)
+ {
+ UserItemData data = GetUserData(user, true);
+
+ if (wasPlayed)
+ {
+ data.PlayCount = Math.Max(data.PlayCount, 1);
+ }
+ else
+ {
+ data.PlayCount = 0;
+ data.PlaybackPositionTicks = 0;
+ }
+ }
+ }
+}
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs new file mode 100644 index 0000000000..a9c92c1fa4 --- /dev/null +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -0,0 +1,323 @@ +using MediaBrowser.Model.Entities;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace MediaBrowser.Controller.Entities
+{
+ public class Folder : BaseItem
+ {
+ public override bool IsFolder
+ {
+ get
+ {
+ return true;
+ }
+ }
+
+ public bool IsRoot { get; set; }
+
+ public bool IsVirtualFolder
+ {
+ get
+ {
+ return Parent != null && Parent.IsRoot;
+ }
+ }
+
+ public IEnumerable<BaseItem> Children { get; set; }
+
+ /// <summary>
+ /// Gets allowed children of an item
+ /// </summary>
+ public IEnumerable<BaseItem> GetParentalAllowedChildren(User user)
+ {
+ return Children.Where(c => c.IsParentalAllowed(user));
+ }
+
+ /// <summary>
+ /// Gets allowed recursive children of an item
+ /// </summary>
+ public IEnumerable<BaseItem> GetParentalAllowedRecursiveChildren(User user)
+ {
+ foreach (var item in GetParentalAllowedChildren(user))
+ {
+ yield return item;
+
+ var subFolder = item as Folder;
+
+ if (subFolder != null)
+ {
+ foreach (var subitem in subFolder.GetParentalAllowedRecursiveChildren(user))
+ {
+ yield return subitem;
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Since it can be slow to make all of these calculations at once, this method will provide a way to get them all back together
+ /// </summary>
+ public ItemSpecialCounts GetSpecialCounts(User user)
+ {
+ ItemSpecialCounts counts = new ItemSpecialCounts();
+
+ IEnumerable<BaseItem> recursiveChildren = GetParentalAllowedRecursiveChildren(user);
+
+ counts.RecentlyAddedItemCount = GetRecentlyAddedItems(recursiveChildren, user).Count();
+ counts.RecentlyAddedUnPlayedItemCount = GetRecentlyAddedUnplayedItems(recursiveChildren, user).Count();
+ counts.InProgressItemCount = GetInProgressItems(recursiveChildren, user).Count();
+ counts.PlayedPercentage = GetPlayedPercentage(recursiveChildren, user);
+
+ return counts;
+ }
+
+ /// <summary>
+ /// Finds all recursive items within a top-level parent that contain the given genre and are allowed for the current user
+ /// </summary>
+ public IEnumerable<BaseItem> GetItemsWithGenre(string genre, User user)
+ {
+ return GetParentalAllowedRecursiveChildren(user).Where(f => f.Genres != null && f.Genres.Any(s => s.Equals(genre, StringComparison.OrdinalIgnoreCase)));
+ }
+
+ /// <summary>
+ /// Finds all recursive items within a top-level parent that contain the given year and are allowed for the current user
+ /// </summary>
+ public IEnumerable<BaseItem> GetItemsWithYear(int year, User user)
+ {
+ return GetParentalAllowedRecursiveChildren(user).Where(f => f.ProductionYear.HasValue && f.ProductionYear == year);
+ }
+
+ /// <summary>
+ /// Finds all recursive items within a top-level parent that contain the given studio and are allowed for the current user
+ /// </summary>
+ public IEnumerable<BaseItem> GetItemsWithStudio(string studio, User user)
+ {
+ return GetParentalAllowedRecursiveChildren(user).Where(f => f.Studios != null && f.Studios.Any(s => s.Equals(studio, StringComparison.OrdinalIgnoreCase)));
+ }
+
+ /// <summary>
+ /// Finds all recursive items within a top-level parent that the user has marked as a favorite
+ /// </summary>
+ public IEnumerable<BaseItem> GetFavoriteItems(User user)
+ {
+ return GetParentalAllowedRecursiveChildren(user).Where(c =>
+ {
+ UserItemData data = c.GetUserData(user, false);
+
+ if (data != null)
+ {
+ return data.IsFavorite;
+ }
+
+ return false;
+ });
+ }
+
+ /// <summary>
+ /// Finds all recursive items within a top-level parent that contain the given person and are allowed for the current user
+ /// </summary>
+ public IEnumerable<BaseItem> GetItemsWithPerson(string person, User user)
+ {
+ return GetParentalAllowedRecursiveChildren(user).Where(c =>
+ {
+ if (c.People != null)
+ {
+ return c.People.ContainsKey(person);
+ }
+
+ return false;
+ });
+ }
+
+ /// <summary>
+ /// Finds all recursive items within a top-level parent that contain the given person and are allowed for the current user
+ /// </summary>
+ /// <param name="personType">Specify this to limit results to a specific PersonType</param>
+ public IEnumerable<BaseItem> GetItemsWithPerson(string person, string personType, User user)
+ {
+ return GetParentalAllowedRecursiveChildren(user).Where(c =>
+ {
+ if (c.People != null)
+ {
+ return c.People.ContainsKey(person) && c.People[person].Type.Equals(personType, StringComparison.OrdinalIgnoreCase);
+ }
+
+ return false;
+ });
+ }
+
+ /// <summary>
+ /// Gets all recently added items (recursive) within a folder, based on configuration and parental settings
+ /// </summary>
+ public IEnumerable<BaseItem> GetRecentlyAddedItems(User user)
+ {
+ return GetRecentlyAddedItems(GetParentalAllowedRecursiveChildren(user), user);
+ }
+
+ /// <summary>
+ /// Gets all recently added unplayed items (recursive) within a folder, based on configuration and parental settings
+ /// </summary>
+ public IEnumerable<BaseItem> GetRecentlyAddedUnplayedItems(User user)
+ {
+ return GetRecentlyAddedUnplayedItems(GetParentalAllowedRecursiveChildren(user), user);
+ }
+
+ /// <summary>
+ /// Gets all in-progress items (recursive) within a folder
+ /// </summary>
+ public IEnumerable<BaseItem> GetInProgressItems(User user)
+ {
+ return GetInProgressItems(GetParentalAllowedRecursiveChildren(user), user);
+ }
+
+ /// <summary>
+ /// Takes a list of items and returns the ones that are recently added
+ /// </summary>
+ private static IEnumerable<BaseItem> GetRecentlyAddedItems(IEnumerable<BaseItem> itemSet, User user)
+ {
+ return itemSet.Where(i => !(i.IsFolder) && i.IsRecentlyAdded(user));
+ }
+
+ /// <summary>
+ /// Takes a list of items and returns the ones that are recently added and unplayed
+ /// </summary>
+ private static IEnumerable<BaseItem> GetRecentlyAddedUnplayedItems(IEnumerable<BaseItem> itemSet, User user)
+ {
+ return GetRecentlyAddedItems(itemSet, user).Where(i =>
+ {
+ var userdata = i.GetUserData(user, false);
+
+ return userdata == null || userdata.PlayCount == 0;
+ });
+ }
+
+ /// <summary>
+ /// Takes a list of items and returns the ones that are in progress
+ /// </summary>
+ private static IEnumerable<BaseItem> GetInProgressItems(IEnumerable<BaseItem> itemSet, User user)
+ {
+ return itemSet.Where(i =>
+ {
+ if (i.IsFolder)
+ {
+ return false;
+ }
+
+ var userdata = i.GetUserData(user, false);
+
+ return userdata != null && userdata.PlaybackPositionTicks > 0;
+ });
+ }
+
+ /// <summary>
+ /// Gets the total played percentage for a set of items
+ /// </summary>
+ private static decimal GetPlayedPercentage(IEnumerable<BaseItem> itemSet, User user)
+ {
+ itemSet = itemSet.Where(i => !(i.IsFolder));
+
+ if (!itemSet.Any())
+ {
+ return 0;
+ }
+
+ decimal totalPercent = 0;
+
+ foreach (BaseItem item in itemSet)
+ {
+ UserItemData data = item.GetUserData(user, false);
+
+ if (data == null)
+ {
+ continue;
+ }
+
+ if (data.PlayCount > 0)
+ {
+ totalPercent += 100;
+ }
+ else if (data.PlaybackPositionTicks > 0 && item.RunTimeTicks.HasValue)
+ {
+ decimal itemPercent = data.PlaybackPositionTicks;
+ itemPercent /= item.RunTimeTicks.Value;
+ totalPercent += itemPercent;
+ }
+ }
+
+ return totalPercent / itemSet.Count();
+ }
+
+ /// <summary>
+ /// Marks the item as either played or unplayed
+ /// </summary>
+ public override void SetPlayedStatus(User user, bool wasPlayed)
+ {
+ base.SetPlayedStatus(user, wasPlayed);
+
+ // Now sweep through recursively and update status
+ foreach (BaseItem item in GetParentalAllowedChildren(user))
+ {
+ item.SetPlayedStatus(user, wasPlayed);
+ }
+ }
+
+ /// <summary>
+ /// Finds an item by ID, recursively
+ /// </summary>
+ public override BaseItem FindItemById(Guid id)
+ {
+ var result = base.FindItemById(id);
+
+ if (result != null)
+ {
+ return result;
+ }
+
+ foreach (BaseItem item in Children)
+ {
+ result = item.FindItemById(id);
+
+ if (result != null)
+ {
+ return result;
+ }
+ }
+
+ return null;
+ }
+
+ /// <summary>
+ /// Finds an item by path, recursively
+ /// </summary>
+ public BaseItem FindByPath(string path)
+ {
+ if (Path.Equals(path, StringComparison.OrdinalIgnoreCase))
+ {
+ return this;
+ }
+
+ foreach (BaseItem item in Children)
+ {
+ var folder = item as Folder;
+
+ if (folder != null)
+ {
+ var foundItem = folder.FindByPath(path);
+
+ if (foundItem != null)
+ {
+ return foundItem;
+ }
+ }
+ else if (item.Path.Equals(path, StringComparison.OrdinalIgnoreCase))
+ {
+ return item;
+ }
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/MediaBrowser.Controller/Entities/Genre.cs b/MediaBrowser.Controller/Entities/Genre.cs new file mode 100644 index 0000000000..ba343a2bc6 --- /dev/null +++ b/MediaBrowser.Controller/Entities/Genre.cs @@ -0,0 +1,7 @@ +
+namespace MediaBrowser.Controller.Entities
+{
+ public class Genre : BaseEntity
+ {
+ }
+}
diff --git a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs new file mode 100644 index 0000000000..cb841530ee --- /dev/null +++ b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs @@ -0,0 +1,7 @@ +
+namespace MediaBrowser.Controller.Entities.Movies
+{
+ public class BoxSet : Folder
+ {
+ }
+}
diff --git a/MediaBrowser.Controller/Entities/Movies/Movie.cs b/MediaBrowser.Controller/Entities/Movies/Movie.cs new file mode 100644 index 0000000000..2d98fa06e8 --- /dev/null +++ b/MediaBrowser.Controller/Entities/Movies/Movie.cs @@ -0,0 +1,31 @@ +using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace MediaBrowser.Controller.Entities.Movies
+{
+ public class Movie : Video
+ {
+ public IEnumerable<Video> SpecialFeatures { get; set; }
+
+ /// <summary>
+ /// Finds an item by ID, recursively
+ /// </summary>
+ public override BaseItem FindItemById(Guid id)
+ {
+ var item = base.FindItemById(id);
+
+ if (item != null)
+ {
+ return item;
+ }
+
+ if (SpecialFeatures != null)
+ {
+ return SpecialFeatures.FirstOrDefault(i => i.Id == id);
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/MediaBrowser.Controller/Entities/Person.cs b/MediaBrowser.Controller/Entities/Person.cs new file mode 100644 index 0000000000..a12b9e38e2 --- /dev/null +++ b/MediaBrowser.Controller/Entities/Person.cs @@ -0,0 +1,25 @@ +
+namespace MediaBrowser.Controller.Entities
+{
+ /// <summary>
+ /// This is the full Person object that can be retrieved with all of it's data.
+ /// </summary>
+ public class Person : BaseEntity
+ {
+ }
+
+ /// <summary>
+ /// This is the small Person stub that is attached to BaseItems
+ /// </summary>
+ public class PersonInfo
+ {
+ public string Name { get; set; }
+ public string Overview { get; set; }
+ public string Type { get; set; }
+
+ public override string ToString()
+ {
+ return Name;
+ }
+ }
+}
diff --git a/MediaBrowser.Controller/Entities/Studio.cs b/MediaBrowser.Controller/Entities/Studio.cs new file mode 100644 index 0000000000..b7c6e6aa43 --- /dev/null +++ b/MediaBrowser.Controller/Entities/Studio.cs @@ -0,0 +1,7 @@ +
+namespace MediaBrowser.Controller.Entities
+{
+ public class Studio : BaseEntity
+ {
+ }
+}
diff --git a/MediaBrowser.Controller/Entities/TV/Episode.cs b/MediaBrowser.Controller/Entities/TV/Episode.cs new file mode 100644 index 0000000000..5d599fca7f --- /dev/null +++ b/MediaBrowser.Controller/Entities/TV/Episode.cs @@ -0,0 +1,7 @@ +
+namespace MediaBrowser.Controller.Entities.TV
+{
+ public class Episode : Video
+ {
+ }
+}
diff --git a/MediaBrowser.Controller/Entities/TV/Season.cs b/MediaBrowser.Controller/Entities/TV/Season.cs new file mode 100644 index 0000000000..98ad31220f --- /dev/null +++ b/MediaBrowser.Controller/Entities/TV/Season.cs @@ -0,0 +1,28 @@ +using System;
+
+namespace MediaBrowser.Controller.Entities.TV
+{
+ public class Season : Folder
+ {
+ /// <summary>
+ /// Store these to reduce disk access in Episode Resolver
+ /// </summary>
+ public string[] MetadataFiles { get; set; }
+
+ /// <summary>
+ /// Determines if the metafolder contains a given file
+ /// </summary>
+ public bool ContainsMetadataFile(string file)
+ {
+ for (int i = 0; i < MetadataFiles.Length; i++)
+ {
+ if (MetadataFiles[i].Equals(file, StringComparison.OrdinalIgnoreCase))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.cs new file mode 100644 index 0000000000..7c228a53df --- /dev/null +++ b/MediaBrowser.Controller/Entities/TV/Series.cs @@ -0,0 +1,12 @@ +using System;
+using System.Collections.Generic;
+
+namespace MediaBrowser.Controller.Entities.TV
+{
+ public class Series : Folder
+ {
+ public string Status { get; set; }
+ public IEnumerable<DayOfWeek> AirDays { get; set; }
+ public string AirTime { get; set; }
+ }
+}
diff --git a/MediaBrowser.Controller/Entities/User.cs b/MediaBrowser.Controller/Entities/User.cs new file mode 100644 index 0000000000..01eadfafb2 --- /dev/null +++ b/MediaBrowser.Controller/Entities/User.cs @@ -0,0 +1,21 @@ +using System;
+
+namespace MediaBrowser.Controller.Entities
+{
+ public class User : BaseEntity
+ {
+ public string Password { get; set; }
+
+ public string MaxParentalRating { get; set; }
+
+ public int RecentItemDays { get; set; }
+
+ public User()
+ {
+ RecentItemDays = 14;
+ }
+
+ public DateTime? LastLoginDate { get; set; }
+ public DateTime? LastActivityDate { get; set; }
+ }
+}
diff --git a/MediaBrowser.Controller/Entities/UserItemData.cs b/MediaBrowser.Controller/Entities/UserItemData.cs new file mode 100644 index 0000000000..b342b9583f --- /dev/null +++ b/MediaBrowser.Controller/Entities/UserItemData.cs @@ -0,0 +1,67 @@ +using System;
+using System.Runtime.Serialization;
+
+namespace MediaBrowser.Model.Entities
+{
+ public class UserItemData
+ {
+ private float? _Rating = null;
+ /// <summary>
+ /// Gets or sets the users 0-10 rating
+ /// </summary>
+ public float? Rating
+ {
+ get
+ {
+ return _Rating;
+ }
+ set
+ {
+ if (value.HasValue)
+ {
+ if (value.Value < 0 || value.Value > 10)
+ {
+ throw new InvalidOperationException("A 0-10 rating is required for UserItemData.");
+ }
+ }
+
+ _Rating = value;
+ }
+ }
+
+ public long PlaybackPositionTicks { get; set; }
+
+ public int PlayCount { get; set; }
+
+ public bool IsFavorite { get; set; }
+
+ /// <summary>
+ /// This is an interpreted property to indicate likes or dislikes
+ /// This should never be serialized.
+ /// </summary>
+ [IgnoreDataMember]
+ public bool? Likes
+ {
+ get
+ {
+ if (Rating != null)
+ {
+ return Rating >= 6.5;
+ }
+
+ return null;
+ }
+ set
+ {
+ if (value.HasValue)
+ {
+ Rating = value.Value ? 10 : 1;
+ }
+ else
+ {
+ Rating = null;
+ }
+ }
+ }
+ }
+}
diff --git a/MediaBrowser.Controller/Entities/Video.cs b/MediaBrowser.Controller/Entities/Video.cs new file mode 100644 index 0000000000..8dd82fab99 --- /dev/null +++ b/MediaBrowser.Controller/Entities/Video.cs @@ -0,0 +1,20 @@ +using MediaBrowser.Model.Entities;
+using System.Collections.Generic;
+
+namespace MediaBrowser.Controller.Entities
+{
+ public class Video : BaseItem
+ {
+ public VideoType VideoType { get; set; }
+
+ public List<SubtitleStream> Subtitles { get; set; }
+ public List<AudioStream> AudioStreams { get; set; }
+
+ public int Height { get; set; }
+ public int Width { get; set; }
+ public string ScanType { get; set; }
+ public float FrameRate { get; set; }
+ public int BitRate { get; set; }
+ public string Codec { get; set; }
+ }
+}
diff --git a/MediaBrowser.Controller/Entities/Year.cs b/MediaBrowser.Controller/Entities/Year.cs new file mode 100644 index 0000000000..d0b29de56c --- /dev/null +++ b/MediaBrowser.Controller/Entities/Year.cs @@ -0,0 +1,7 @@ +
+namespace MediaBrowser.Controller.Entities
+{
+ public class Year : BaseEntity
+ {
+ }
+}
diff --git a/MediaBrowser.Controller/FFMpeg/FFProbe.cs b/MediaBrowser.Controller/FFMpeg/FFProbe.cs index da5e11c5b7..d4c07f07b0 100644 --- a/MediaBrowser.Controller/FFMpeg/FFProbe.cs +++ b/MediaBrowser.Controller/FFMpeg/FFProbe.cs @@ -1,10 +1,10 @@ -using System;
+using MediaBrowser.Common.Logging;
+using MediaBrowser.Common.Serialization;
+using MediaBrowser.Controller.Entities;
+using System;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
-using MediaBrowser.Common.Logging;
-using MediaBrowser.Common.Serialization;
-using MediaBrowser.Model.Entities;
namespace MediaBrowser.Controller.FFMpeg
{
diff --git a/MediaBrowser.Controller/IO/DirectoryWatchers.cs b/MediaBrowser.Controller/IO/DirectoryWatchers.cs index 10d11385ee..837c02cb90 100644 --- a/MediaBrowser.Controller/IO/DirectoryWatchers.cs +++ b/MediaBrowser.Controller/IO/DirectoryWatchers.cs @@ -1,10 +1,10 @@ -using System;
+using MediaBrowser.Controller.Entities;
+using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
-using MediaBrowser.Model.Entities;
namespace MediaBrowser.Controller.IO
{
diff --git a/MediaBrowser.Controller/Kernel.cs b/MediaBrowser.Controller/Kernel.cs index f493d33002..47a3773b34 100644 --- a/MediaBrowser.Controller/Kernel.cs +++ b/MediaBrowser.Controller/Kernel.cs @@ -1,5 +1,7 @@ using MediaBrowser.Common.Kernel;
using MediaBrowser.Common.Logging;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.IO;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Providers;
@@ -7,8 +9,6 @@ using MediaBrowser.Controller.Resolvers; using MediaBrowser.Controller.Weather;
using MediaBrowser.Model.Authentication;
using MediaBrowser.Model.Configuration;
-using MediaBrowser.Model.Entities;
-using MediaBrowser.Model.Entities.TV;
using MediaBrowser.Model.Progress;
using System;
using System.Collections.Generic;
diff --git a/MediaBrowser.Controller/Library/ItemController.cs b/MediaBrowser.Controller/Library/ItemController.cs index 2dae0de041..9e0c94b793 100644 --- a/MediaBrowser.Controller/Library/ItemController.cs +++ b/MediaBrowser.Controller/Library/ItemController.cs @@ -1,5 +1,5 @@ -using MediaBrowser.Controller.IO;
-using MediaBrowser.Model.Entities;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.IO;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
diff --git a/MediaBrowser.Controller/Library/ItemResolveEventArgs.cs b/MediaBrowser.Controller/Library/ItemResolveEventArgs.cs index bace0ca49f..5d207de13e 100644 --- a/MediaBrowser.Controller/Library/ItemResolveEventArgs.cs +++ b/MediaBrowser.Controller/Library/ItemResolveEventArgs.cs @@ -1,7 +1,7 @@ -using System;
-using System.IO;
+using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.IO;
-using MediaBrowser.Model.Entities;
+using System;
+using System.IO;
namespace MediaBrowser.Controller.Library
{
diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 1ebc384d4f..8d1f4965a0 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -50,6 +50,7 @@ <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Rx-Linq.2.0.20823\lib\Net45\System.Reactive.Linq.dll</HintPath>
</Reference>
+ <Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
@@ -57,6 +58,22 @@ <Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="Entities\Audio.cs" />
+ <Compile Include="Entities\BaseEntity.cs" />
+ <Compile Include="Entities\BaseItem.cs" />
+ <Compile Include="Entities\Folder.cs" />
+ <Compile Include="Entities\Genre.cs" />
+ <Compile Include="Entities\Movies\BoxSet.cs" />
+ <Compile Include="Entities\Movies\Movie.cs" />
+ <Compile Include="Entities\Person.cs" />
+ <Compile Include="Entities\Studio.cs" />
+ <Compile Include="Entities\TV\Episode.cs" />
+ <Compile Include="Entities\TV\Season.cs" />
+ <Compile Include="Entities\TV\Series.cs" />
+ <Compile Include="Entities\User.cs" />
+ <Compile Include="Entities\UserItemData.cs" />
+ <Compile Include="Entities\Video.cs" />
+ <Compile Include="Entities\Year.cs" />
<Compile Include="Providers\Movies\MovieProviderFromXml.cs" />
<Compile Include="Providers\Movies\MovieSpecialFeaturesProvider.cs" />
<Compile Include="Providers\TV\EpisodeImageFromMediaLocationProvider.cs" />
diff --git a/MediaBrowser.Controller/Providers/AudioInfoProvider.cs b/MediaBrowser.Controller/Providers/AudioInfoProvider.cs index 5c2f8dea2e..09cd80a210 100644 --- a/MediaBrowser.Controller/Providers/AudioInfoProvider.cs +++ b/MediaBrowser.Controller/Providers/AudioInfoProvider.cs @@ -1,6 +1,6 @@ -using MediaBrowser.Controller.FFMpeg;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.FFMpeg;
using MediaBrowser.Controller.Library;
-using MediaBrowser.Model.Entities;
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
diff --git a/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs b/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs index 96bc47c8d2..a3b0d2c600 100644 --- a/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs +++ b/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Controller.Xml;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Xml;
using MediaBrowser.Model.Entities;
using System;
using System.Collections.Generic;
diff --git a/MediaBrowser.Controller/Providers/BaseMetadataProvider.cs b/MediaBrowser.Controller/Providers/BaseMetadataProvider.cs index 3e3ec59bd9..bae1ff0f9c 100644 --- a/MediaBrowser.Controller/Providers/BaseMetadataProvider.cs +++ b/MediaBrowser.Controller/Providers/BaseMetadataProvider.cs @@ -1,5 +1,5 @@ -using MediaBrowser.Controller.Library;
-using MediaBrowser.Model.Entities;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Library;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.Providers
diff --git a/MediaBrowser.Controller/Providers/FolderProviderFromXml.cs b/MediaBrowser.Controller/Providers/FolderProviderFromXml.cs index 59ef9e5dfe..0f655cf0b9 100644 --- a/MediaBrowser.Controller/Providers/FolderProviderFromXml.cs +++ b/MediaBrowser.Controller/Providers/FolderProviderFromXml.cs @@ -1,5 +1,5 @@ -using MediaBrowser.Controller.Library;
-using MediaBrowser.Model.Entities;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Library;
using System.ComponentModel.Composition;
using System.IO;
using System.Threading.Tasks;
diff --git a/MediaBrowser.Controller/Providers/ImageFromMediaLocationProvider.cs b/MediaBrowser.Controller/Providers/ImageFromMediaLocationProvider.cs index 6c12dac174..6ccb6df7c1 100644 --- a/MediaBrowser.Controller/Providers/ImageFromMediaLocationProvider.cs +++ b/MediaBrowser.Controller/Providers/ImageFromMediaLocationProvider.cs @@ -1,5 +1,5 @@ -using MediaBrowser.Controller.Library;
-using MediaBrowser.Model.Entities;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Library;
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
diff --git a/MediaBrowser.Controller/Providers/LocalTrailerProvider.cs b/MediaBrowser.Controller/Providers/LocalTrailerProvider.cs index 0359a10b20..4e6bcdef87 100644 --- a/MediaBrowser.Controller/Providers/LocalTrailerProvider.cs +++ b/MediaBrowser.Controller/Providers/LocalTrailerProvider.cs @@ -1,6 +1,6 @@ -using MediaBrowser.Controller.IO;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.IO;
using MediaBrowser.Controller.Library;
-using MediaBrowser.Model.Entities;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.IO;
diff --git a/MediaBrowser.Controller/Providers/Movies/MovieProviderFromXml.cs b/MediaBrowser.Controller/Providers/Movies/MovieProviderFromXml.cs index 6432ebee8a..4f18cd5f91 100644 --- a/MediaBrowser.Controller/Providers/Movies/MovieProviderFromXml.cs +++ b/MediaBrowser.Controller/Providers/Movies/MovieProviderFromXml.cs @@ -1,7 +1,6 @@ -using MediaBrowser.Controller.Library;
-using MediaBrowser.Controller.Xml;
-using MediaBrowser.Model.Entities;
-using MediaBrowser.Model.Entities.Movies;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Entities.Movies;
+using MediaBrowser.Controller.Library;
using System.ComponentModel.Composition;
using System.IO;
using System.Threading.Tasks;
diff --git a/MediaBrowser.Controller/Providers/Movies/MovieSpecialFeaturesProvider.cs b/MediaBrowser.Controller/Providers/Movies/MovieSpecialFeaturesProvider.cs index cb028602e4..2fb5caf8e2 100644 --- a/MediaBrowser.Controller/Providers/Movies/MovieSpecialFeaturesProvider.cs +++ b/MediaBrowser.Controller/Providers/Movies/MovieSpecialFeaturesProvider.cs @@ -1,7 +1,7 @@ -using MediaBrowser.Controller.IO;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Entities.Movies;
+using MediaBrowser.Controller.IO;
using MediaBrowser.Controller.Library;
-using MediaBrowser.Model.Entities;
-using MediaBrowser.Model.Entities.Movies;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.IO;
diff --git a/MediaBrowser.Controller/Providers/TV/EpisodeImageFromMediaLocationProvider.cs b/MediaBrowser.Controller/Providers/TV/EpisodeImageFromMediaLocationProvider.cs index 10a7045192..8533d19d9e 100644 --- a/MediaBrowser.Controller/Providers/TV/EpisodeImageFromMediaLocationProvider.cs +++ b/MediaBrowser.Controller/Providers/TV/EpisodeImageFromMediaLocationProvider.cs @@ -1,6 +1,6 @@ -using MediaBrowser.Controller.Library;
-using MediaBrowser.Model.Entities;
-using MediaBrowser.Model.Entities.TV;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Entities.TV;
+using MediaBrowser.Controller.Library;
using System.ComponentModel.Composition;
using System.IO;
using System.Linq;
diff --git a/MediaBrowser.Controller/Providers/TV/EpisodeProviderFromXml.cs b/MediaBrowser.Controller/Providers/TV/EpisodeProviderFromXml.cs index fc52646dfd..953eb1ec42 100644 --- a/MediaBrowser.Controller/Providers/TV/EpisodeProviderFromXml.cs +++ b/MediaBrowser.Controller/Providers/TV/EpisodeProviderFromXml.cs @@ -1,6 +1,6 @@ -using MediaBrowser.Controller.Library;
-using MediaBrowser.Model.Entities;
-using MediaBrowser.Model.Entities.TV;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Entities.TV;
+using MediaBrowser.Controller.Library;
using System.ComponentModel.Composition;
using System.IO;
using System.Threading.Tasks;
diff --git a/MediaBrowser.Controller/Providers/TV/EpisodeXmlParser.cs b/MediaBrowser.Controller/Providers/TV/EpisodeXmlParser.cs index 06db12c970..fad1a04b4f 100644 --- a/MediaBrowser.Controller/Providers/TV/EpisodeXmlParser.cs +++ b/MediaBrowser.Controller/Providers/TV/EpisodeXmlParser.cs @@ -1,4 +1,4 @@ -using MediaBrowser.Model.Entities.TV;
+using MediaBrowser.Controller.Entities.TV;
using System.IO;
using System.Xml;
diff --git a/MediaBrowser.Controller/Providers/TV/SeriesProviderFromXml.cs b/MediaBrowser.Controller/Providers/TV/SeriesProviderFromXml.cs index aa1dc8aaa8..95f4f9adca 100644 --- a/MediaBrowser.Controller/Providers/TV/SeriesProviderFromXml.cs +++ b/MediaBrowser.Controller/Providers/TV/SeriesProviderFromXml.cs @@ -1,6 +1,6 @@ -using MediaBrowser.Controller.Library;
-using MediaBrowser.Model.Entities;
-using MediaBrowser.Model.Entities.TV;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Entities.TV;
+using MediaBrowser.Controller.Library;
using System.ComponentModel.Composition;
using System.IO;
using System.Threading.Tasks;
diff --git a/MediaBrowser.Controller/Providers/TV/SeriesXmlParser.cs b/MediaBrowser.Controller/Providers/TV/SeriesXmlParser.cs index 8ef0ee853e..36c0a99efd 100644 --- a/MediaBrowser.Controller/Providers/TV/SeriesXmlParser.cs +++ b/MediaBrowser.Controller/Providers/TV/SeriesXmlParser.cs @@ -1,5 +1,5 @@ -using MediaBrowser.Model.Entities;
-using MediaBrowser.Model.Entities.TV;
+using MediaBrowser.Controller.Entities.TV;
+using MediaBrowser.Model.Entities;
using System;
using System.Xml;
diff --git a/MediaBrowser.Controller/Providers/VideoInfoProvider.cs b/MediaBrowser.Controller/Providers/VideoInfoProvider.cs index e749165f8d..640d1b27f1 100644 --- a/MediaBrowser.Controller/Providers/VideoInfoProvider.cs +++ b/MediaBrowser.Controller/Providers/VideoInfoProvider.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Controller.FFMpeg;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.FFMpeg;
using MediaBrowser.Model.Entities;
using System;
using System.Collections.Generic;
diff --git a/MediaBrowser.Controller/Resolvers/AudioResolver.cs b/MediaBrowser.Controller/Resolvers/AudioResolver.cs index c67bc0d4d7..8f10e45e50 100644 --- a/MediaBrowser.Controller/Resolvers/AudioResolver.cs +++ b/MediaBrowser.Controller/Resolvers/AudioResolver.cs @@ -1,5 +1,5 @@ -using MediaBrowser.Controller.Library;
-using MediaBrowser.Model.Entities;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Library;
using System.ComponentModel.Composition;
using System.IO;
diff --git a/MediaBrowser.Controller/Resolvers/BaseItemResolver.cs b/MediaBrowser.Controller/Resolvers/BaseItemResolver.cs index 1f5a6fe831..1508252ebb 100644 --- a/MediaBrowser.Controller/Resolvers/BaseItemResolver.cs +++ b/MediaBrowser.Controller/Resolvers/BaseItemResolver.cs @@ -1,8 +1,8 @@ -using System;
-using System.IO;
+using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.IO;
using MediaBrowser.Controller.Library;
-using MediaBrowser.Model.Entities;
+using System;
+using System.IO;
namespace MediaBrowser.Controller.Resolvers
{
diff --git a/MediaBrowser.Controller/Resolvers/FolderResolver.cs b/MediaBrowser.Controller/Resolvers/FolderResolver.cs index 6857c35742..028c85f862 100644 --- a/MediaBrowser.Controller/Resolvers/FolderResolver.cs +++ b/MediaBrowser.Controller/Resolvers/FolderResolver.cs @@ -1,6 +1,6 @@ -using System.ComponentModel.Composition;
+using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
-using MediaBrowser.Model.Entities;
+using System.ComponentModel.Composition;
namespace MediaBrowser.Controller.Resolvers
{
diff --git a/MediaBrowser.Controller/Resolvers/Movies/BoxSetResolver.cs b/MediaBrowser.Controller/Resolvers/Movies/BoxSetResolver.cs index ad18762af2..069068067f 100644 --- a/MediaBrowser.Controller/Resolvers/Movies/BoxSetResolver.cs +++ b/MediaBrowser.Controller/Resolvers/Movies/BoxSetResolver.cs @@ -1,5 +1,5 @@ -using MediaBrowser.Controller.Library;
-using MediaBrowser.Model.Entities.Movies;
+using MediaBrowser.Controller.Entities.Movies;
+using MediaBrowser.Controller.Library;
using System;
using System.ComponentModel.Composition;
using System.IO;
diff --git a/MediaBrowser.Controller/Resolvers/Movies/MovieResolver.cs b/MediaBrowser.Controller/Resolvers/Movies/MovieResolver.cs index 0f2e81b34e..ae30a63872 100644 --- a/MediaBrowser.Controller/Resolvers/Movies/MovieResolver.cs +++ b/MediaBrowser.Controller/Resolvers/Movies/MovieResolver.cs @@ -1,7 +1,8 @@ -using MediaBrowser.Controller.IO;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Entities.Movies;
+using MediaBrowser.Controller.IO;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Entities;
-using MediaBrowser.Model.Entities.Movies;
using System.ComponentModel.Composition;
namespace MediaBrowser.Controller.Resolvers.Movies
diff --git a/MediaBrowser.Controller/Resolvers/TV/EpisodeResolver.cs b/MediaBrowser.Controller/Resolvers/TV/EpisodeResolver.cs index 6d1261dfb0..0961edd1ac 100644 --- a/MediaBrowser.Controller/Resolvers/TV/EpisodeResolver.cs +++ b/MediaBrowser.Controller/Resolvers/TV/EpisodeResolver.cs @@ -1,5 +1,5 @@ -using MediaBrowser.Controller.Library;
-using MediaBrowser.Model.Entities.TV;
+using MediaBrowser.Controller.Entities.TV;
+using MediaBrowser.Controller.Library;
using System.ComponentModel.Composition;
namespace MediaBrowser.Controller.Resolvers.TV
diff --git a/MediaBrowser.Controller/Resolvers/TV/SeasonResolver.cs b/MediaBrowser.Controller/Resolvers/TV/SeasonResolver.cs index 0bb880b787..3b54a1aff8 100644 --- a/MediaBrowser.Controller/Resolvers/TV/SeasonResolver.cs +++ b/MediaBrowser.Controller/Resolvers/TV/SeasonResolver.cs @@ -1,5 +1,5 @@ -using MediaBrowser.Controller.Library;
-using MediaBrowser.Model.Entities.TV;
+using MediaBrowser.Controller.Entities.TV;
+using MediaBrowser.Controller.Library;
using System.ComponentModel.Composition;
using System.IO;
diff --git a/MediaBrowser.Controller/Resolvers/TV/SeriesResolver.cs b/MediaBrowser.Controller/Resolvers/TV/SeriesResolver.cs index dd82b14484..3c43e460c5 100644 --- a/MediaBrowser.Controller/Resolvers/TV/SeriesResolver.cs +++ b/MediaBrowser.Controller/Resolvers/TV/SeriesResolver.cs @@ -1,6 +1,6 @@ -using MediaBrowser.Controller.Library;
+using MediaBrowser.Controller.Entities.TV;
+using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Entities;
-using MediaBrowser.Model.Entities.TV;
using System;
using System.ComponentModel.Composition;
using System.IO;
diff --git a/MediaBrowser.Controller/Resolvers/VideoResolver.cs b/MediaBrowser.Controller/Resolvers/VideoResolver.cs index 90bc658b74..316c7798a1 100644 --- a/MediaBrowser.Controller/Resolvers/VideoResolver.cs +++ b/MediaBrowser.Controller/Resolvers/VideoResolver.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Controller.Library;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Entities;
using System.ComponentModel.Composition;
using System.IO;
|
