aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller')
-rw-r--r--MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs4
-rw-r--r--MediaBrowser.Controller/Entities/Audio/Audio.cs30
-rw-r--r--MediaBrowser.Controller/Entities/BaseItem.cs72
-rw-r--r--MediaBrowser.Controller/Entities/Book.cs11
-rw-r--r--MediaBrowser.Controller/Entities/Folder.cs47
-rw-r--r--MediaBrowser.Controller/Entities/Game.cs7
-rw-r--r--MediaBrowser.Controller/Entities/InternalItemsQuery.cs18
-rw-r--r--MediaBrowser.Controller/Entities/Person.cs9
-rw-r--r--MediaBrowser.Controller/Entities/Photo.cs2
-rw-r--r--MediaBrowser.Controller/Entities/Studio.cs7
-rw-r--r--MediaBrowser.Controller/Entities/TV/Episode.cs14
-rw-r--r--MediaBrowser.Controller/Entities/User.cs20
-rw-r--r--MediaBrowser.Controller/Entities/UserRootFolder.cs7
-rw-r--r--MediaBrowser.Controller/Entities/UserView.cs15
-rw-r--r--MediaBrowser.Controller/Entities/Video.cs6
-rw-r--r--MediaBrowser.Controller/Library/ILibraryManager.cs18
-rw-r--r--MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs6
-rw-r--r--MediaBrowser.Controller/LiveTv/LiveTvProgram.cs44
-rw-r--r--MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs6
-rw-r--r--MediaBrowser.Controller/MediaBrowser.Controller.csproj1
-rw-r--r--MediaBrowser.Controller/Net/PaymentRequiredException.cs15
-rw-r--r--MediaBrowser.Controller/Persistence/IItemRepository.cs7
-rw-r--r--MediaBrowser.Controller/Providers/MetadataStatus.cs14
23 files changed, 259 insertions, 121 deletions
diff --git a/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs b/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs
index d8f5d52c3..e6bf86853 100644
--- a/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs
+++ b/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs
@@ -25,7 +25,7 @@ namespace MediaBrowser.Controller.Drawing
public int? MaxHeight { get; set; }
- public int? Quality { get; set; }
+ public int Quality { get; set; }
public List<IImageEnhancer> Enhancers { get; set; }
@@ -50,7 +50,7 @@ namespace MediaBrowser.Controller.Drawing
public bool HasDefaultOptionsWithoutSize(string originalImagePath)
{
- return (!Quality.HasValue || Quality.Value == 100) &&
+ return (Quality == 100) &&
IsOutputFormatDefault(originalImagePath) &&
!AddPlayedIndicator &&
PercentPlayed.Equals(0) &&
diff --git a/MediaBrowser.Controller/Entities/Audio/Audio.cs b/MediaBrowser.Controller/Entities/Audio/Audio.cs
index 43b980c20..6feffc3ef 100644
--- a/MediaBrowser.Controller/Entities/Audio/Audio.cs
+++ b/MediaBrowser.Controller/Entities/Audio/Audio.cs
@@ -27,9 +27,22 @@ namespace MediaBrowser.Controller.Entities.Audio
public long? Size { get; set; }
public string Container { get; set; }
public int? TotalBitrate { get; set; }
- public List<string> Tags { get; set; }
public ExtraType? ExtraType { get; set; }
+ /// <summary>
+ /// Gets or sets the artist.
+ /// </summary>
+ /// <value>The artist.</value>
+ public List<string> Artists { get; set; }
+
+ public List<string> AlbumArtists { get; set; }
+
+ /// <summary>
+ /// Gets or sets the album.
+ /// </summary>
+ /// <value>The album.</value>
+ public string Album { get; set; }
+
[IgnoreDataMember]
public bool IsThemeMedia
{
@@ -43,7 +56,6 @@ namespace MediaBrowser.Controller.Entities.Audio
{
Artists = new List<string>();
AlbumArtists = new List<string>();
- Tags = new List<string>();
}
[IgnoreDataMember]
@@ -92,14 +104,6 @@ namespace MediaBrowser.Controller.Entities.Audio
locationType != LocationType.Virtual;
}
- /// <summary>
- /// Gets or sets the artist.
- /// </summary>
- /// <value>The artist.</value>
- public List<string> Artists { get; set; }
-
- public List<string> AlbumArtists { get; set; }
-
[IgnoreDataMember]
public List<string> AllArtists
{
@@ -114,12 +118,6 @@ namespace MediaBrowser.Controller.Entities.Audio
}
}
- /// <summary>
- /// Gets or sets the album.
- /// </summary>
- /// <value>The album.</value>
- public string Album { get; set; }
-
[IgnoreDataMember]
public MusicAlbum AlbumEntity
{
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs
index ec688bd9f..f14e09616 100644
--- a/MediaBrowser.Controller/Entities/BaseItem.cs
+++ b/MediaBrowser.Controller/Entities/BaseItem.cs
@@ -24,6 +24,7 @@ using System.Runtime.Serialization;
using System.Threading;
using System.Threading.Tasks;
using CommonIO;
+using MediaBrowser.Model.LiveTv;
namespace MediaBrowser.Controller.Entities
{
@@ -34,6 +35,7 @@ namespace MediaBrowser.Controller.Entities
{
protected BaseItem()
{
+ Tags = new List<string>();
Genres = new List<string>();
Studios = new List<string>();
ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
@@ -103,7 +105,8 @@ namespace MediaBrowser.Controller.Entities
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
- public string Name
+ [IgnoreDataMember]
+ public virtual string Name
{
get
{
@@ -122,15 +125,24 @@ namespace MediaBrowser.Controller.Entities
/// Gets or sets the id.
/// </summary>
/// <value>The id.</value>
+ [IgnoreDataMember]
public Guid Id { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is hd.
/// </summary>
/// <value><c>true</c> if this instance is hd; otherwise, <c>false</c>.</value>
+ [IgnoreDataMember]
public bool? IsHD { get; set; }
/// <summary>
+ /// Gets or sets the audio.
+ /// </summary>
+ /// <value>The audio.</value>
+ [IgnoreDataMember]
+ public ProgramAudio? Audio { get; set; }
+
+ /// <summary>
/// Return the id that should be used to key display prefs for this item.
/// Default is based on the type for everything except actual generic folders.
/// </summary>
@@ -149,6 +161,7 @@ namespace MediaBrowser.Controller.Entities
/// Gets or sets the path.
/// </summary>
/// <value>The path.</value>
+ [IgnoreDataMember]
public virtual string Path { get; set; }
[IgnoreDataMember]
@@ -173,7 +186,7 @@ namespace MediaBrowser.Controller.Entities
}
/// <summary>
- /// Id of the program.
+ /// If this content came from an external service, the id of the content on that service
/// </summary>
[IgnoreDataMember]
public string ExternalId
@@ -325,12 +338,14 @@ namespace MediaBrowser.Controller.Entities
/// Gets or sets the date created.
/// </summary>
/// <value>The date created.</value>
+ [IgnoreDataMember]
public DateTime DateCreated { get; set; }
/// <summary>
/// Gets or sets the date modified.
/// </summary>
/// <value>The date modified.</value>
+ [IgnoreDataMember]
public DateTime DateModified { get; set; }
public DateTime DateLastSaved { get; set; }
@@ -407,6 +422,7 @@ namespace MediaBrowser.Controller.Entities
/// Gets or sets the name of the forced sort.
/// </summary>
/// <value>The name of the forced sort.</value>
+ [IgnoreDataMember]
public string ForcedSortName
{
get { return _forcedSortName; }
@@ -493,6 +509,7 @@ namespace MediaBrowser.Controller.Entities
return sortable;
}
+ [IgnoreDataMember]
public Guid ParentId { get; set; }
/// <summary>
@@ -559,6 +576,7 @@ namespace MediaBrowser.Controller.Entities
/// When the item first debuted. For movies this could be premiere date, episodes would be first aired
/// </summary>
/// <value>The premiere date.</value>
+ [IgnoreDataMember]
public DateTime? PremiereDate { get; set; }
/// <summary>
@@ -572,31 +590,35 @@ namespace MediaBrowser.Controller.Entities
/// Gets or sets the display type of the media.
/// </summary>
/// <value>The display type of the media.</value>
+ [IgnoreDataMember]
public string DisplayMediaType { get; set; }
/// <summary>
/// Gets or sets the official rating.
/// </summary>
/// <value>The official rating.</value>
+ [IgnoreDataMember]
public string OfficialRating { get; set; }
/// <summary>
/// Gets or sets the official rating description.
/// </summary>
/// <value>The official rating description.</value>
+ [IgnoreDataMember]
public string OfficialRatingDescription { get; set; }
/// <summary>
/// Gets or sets the custom rating.
/// </summary>
/// <value>The custom rating.</value>
- //[IgnoreDataMember]
+ [IgnoreDataMember]
public string CustomRating { get; set; }
/// <summary>
/// Gets or sets the overview.
/// </summary>
/// <value>The overview.</value>
+ [IgnoreDataMember]
public string Overview { get; set; }
/// <summary>
@@ -609,37 +631,48 @@ namespace MediaBrowser.Controller.Entities
/// Gets or sets the genres.
/// </summary>
/// <value>The genres.</value>
+ [IgnoreDataMember]
public List<string> Genres { get; set; }
/// <summary>
+ /// Gets or sets the tags.
+ /// </summary>
+ /// <value>The tags.</value>
+ public List<string> Tags { get; set; }
+
+ /// <summary>
/// Gets or sets the home page URL.
/// </summary>
/// <value>The home page URL.</value>
+ [IgnoreDataMember]
public string HomePageUrl { get; set; }
/// <summary>
/// Gets or sets the community rating.
/// </summary>
/// <value>The community rating.</value>
- //[IgnoreDataMember]
+ [IgnoreDataMember]
public float? CommunityRating { get; set; }
/// <summary>
/// Gets or sets the community rating vote count.
/// </summary>
/// <value>The community rating vote count.</value>
+ [IgnoreDataMember]
public int? VoteCount { get; set; }
/// <summary>
/// Gets or sets the run time ticks.
/// </summary>
/// <value>The run time ticks.</value>
+ [IgnoreDataMember]
public long? RunTimeTicks { get; set; }
/// <summary>
/// Gets or sets the production year.
/// </summary>
/// <value>The production year.</value>
+ [IgnoreDataMember]
public int? ProductionYear { get; set; }
/// <summary>
@@ -647,13 +680,14 @@ namespace MediaBrowser.Controller.Entities
/// This could be episode number, album track number, etc.
/// </summary>
/// <value>The index number.</value>
- //[IgnoreDataMember]
+ [IgnoreDataMember]
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>
/// <value>The parent index number.</value>
+ [IgnoreDataMember]
public int? ParentIndexNumber { get; set; }
[IgnoreDataMember]
@@ -1308,15 +1342,6 @@ namespace MediaBrowser.Controller.Entities
}
/// <summary>
- /// Adds a person to the item
- /// </summary>
- /// <param name="person">The person.</param>
- /// <exception cref="System.ArgumentNullException"></exception>
- public void AddPerson(PersonInfo person)
- {
- }
-
- /// <summary>
/// Adds a studio to the item
/// </summary>
/// <param name="name">The name.</param>
@@ -1873,5 +1898,24 @@ namespace MediaBrowser.Controller.Entities
DateLastSaved.Ticks.ToString(CultureInfo.InvariantCulture)
};
}
+
+ public virtual IEnumerable<Guid> GetAncestorIds()
+ {
+ return Parents.Select(i => i.Id).Concat(LibraryManager.GetCollectionFolders(this).Select(i => i.Id));
+ }
+
+ [IgnoreDataMember]
+ public virtual bool SupportsAncestors
+ {
+ get
+ {
+ return true;
+ }
+ }
+
+ public virtual IEnumerable<Guid> GetIdsForAncestorQuery()
+ {
+ return new[] { Id };
+ }
}
}
diff --git a/MediaBrowser.Controller/Entities/Book.cs b/MediaBrowser.Controller/Entities/Book.cs
index d31675baf..8342c1c10 100644
--- a/MediaBrowser.Controller/Entities/Book.cs
+++ b/MediaBrowser.Controller/Entities/Book.cs
@@ -17,19 +17,8 @@ namespace MediaBrowser.Controller.Entities
}
}
- /// <summary>
- /// Gets or sets the tags.
- /// </summary>
- /// <value>The tags.</value>
- public List<string> Tags { get; set; }
-
public string SeriesName { get; set; }
- public Book()
- {
- Tags = new List<string>();
- }
-
public override bool CanDownload()
{
var locationType = LocationType;
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs
index 05965e1b5..e08eda1ac 100644
--- a/MediaBrowser.Controller/Entities/Folder.cs
+++ b/MediaBrowser.Controller/Entities/Folder.cs
@@ -28,7 +28,6 @@ namespace MediaBrowser.Controller.Entities
public List<Guid> ThemeSongIds { get; set; }
public List<Guid> ThemeVideoIds { get; set; }
- public List<string> Tags { get; set; }
public Folder()
{
@@ -36,7 +35,6 @@ namespace MediaBrowser.Controller.Entities
ThemeSongIds = new List<Guid>();
ThemeVideoIds = new List<Guid>();
- Tags = new List<string>();
}
[IgnoreDataMember]
@@ -151,7 +149,15 @@ namespace MediaBrowser.Controller.Entities
await LibraryManager.CreateItem(item, cancellationToken).ConfigureAwait(false);
- await ItemRepository.SaveChildren(Id, ActualChildren.Select(i => i.Id).ToList(), cancellationToken).ConfigureAwait(false);
+ if (!EnableNewFolderQuerying())
+ {
+ await ItemRepository.SaveChildren(Id, ActualChildren.Select(i => i.Id).ToList(), cancellationToken).ConfigureAwait(false);
+ }
+ }
+
+ private static bool EnableNewFolderQuerying()
+ {
+ return ConfigurationManager.Configuration.MigrationVersion >= 1;
}
protected void AddChildrenInternal(IEnumerable<BaseItem> children)
@@ -224,7 +230,12 @@ namespace MediaBrowser.Controller.Entities
item.SetParent(null);
- return ItemRepository.SaveChildren(Id, ActualChildren.Select(i => i.Id).ToList(), cancellationToken);
+ if (!EnableNewFolderQuerying())
+ {
+ return ItemRepository.SaveChildren(Id, ActualChildren.Select(i => i.Id).ToList(), cancellationToken);
+ }
+
+ return Task.FromResult(true);
}
/// <summary>
@@ -473,6 +484,7 @@ namespace MediaBrowser.Controller.Entities
}
else
{
+ child.SetParent(this);
newItems.Add(child);
validChildren.Add(child);
}
@@ -480,6 +492,7 @@ namespace MediaBrowser.Controller.Entities
else
{
// Brand new item - needs to be added
+ child.SetParent(this);
newItems.Add(child);
validChildren.Add(child);
}
@@ -508,7 +521,6 @@ namespace MediaBrowser.Controller.Entities
}
else
{
- await UpdateIsOffline(item, false).ConfigureAwait(false);
actualRemovals.Add(item);
}
}
@@ -519,6 +531,9 @@ namespace MediaBrowser.Controller.Entities
foreach (var item in actualRemovals)
{
+ item.SetParent(null);
+ item.IsOffline = false;
+ await LibraryManager.DeleteItem(item, new DeleteOptions { DeleteFileLocation = false }).ConfigureAwait(false);
LibraryManager.ReportItemRemoved(item);
}
}
@@ -527,7 +542,10 @@ namespace MediaBrowser.Controller.Entities
AddChildrenInternal(newItems);
- await ItemRepository.SaveChildren(Id, ActualChildren.Select(i => i.Id).ToList(), cancellationToken).ConfigureAwait(false);
+ if (!EnableNewFolderQuerying())
+ {
+ await ItemRepository.SaveChildren(Id, ActualChildren.Select(i => i.Id).ToList(), cancellationToken).ConfigureAwait(false);
+ }
}
}
@@ -757,19 +775,16 @@ namespace MediaBrowser.Controller.Entities
/// <returns>IEnumerable{BaseItem}.</returns>
protected IEnumerable<BaseItem> GetCachedChildren()
{
- if (ConfigurationManager.Configuration.DisableStartupScan)
+ if (EnableNewFolderQuerying())
{
- return ItemRepository.GetChildrenItems(Id).Select(RetrieveChild).Where(i => i != null);
- //return ItemRepository.GetItems(new InternalItemsQuery
- //{
- // ParentId = Id
+ return ItemRepository.GetItemList(new InternalItemsQuery
+ {
+ ParentId = Id
- //}).Items.Select(RetrieveChild).Where(i => i != null);
- }
- else
- {
- return ItemRepository.GetChildrenItems(Id).Select(RetrieveChild).Where(i => i != null);
+ }).Select(RetrieveChild).Where(i => i != null);
}
+
+ return ItemRepository.GetChildrenItems(Id).Select(RetrieveChild).Where(i => i != null);
}
private BaseItem RetrieveChild(BaseItem child)
diff --git a/MediaBrowser.Controller/Entities/Game.cs b/MediaBrowser.Controller/Entities/Game.cs
index ed3e85d58..ea518ce35 100644
--- a/MediaBrowser.Controller/Entities/Game.cs
+++ b/MediaBrowser.Controller/Entities/Game.cs
@@ -21,7 +21,6 @@ namespace MediaBrowser.Controller.Entities
RemoteTrailerIds = new List<Guid>();
ThemeSongIds = new List<Guid>();
ThemeVideoIds = new List<Guid>();
- Tags = new List<string>();
}
public List<Guid> LocalTrailerIds { get; set; }
@@ -35,12 +34,6 @@ namespace MediaBrowser.Controller.Entities
}
/// <summary>
- /// Gets or sets the tags.
- /// </summary>
- /// <value>The tags.</value>
- public List<string> Tags { get; set; }
-
- /// <summary>
/// Gets or sets the remote trailers.
/// </summary>
/// <value>The remote trailers.</value>
diff --git a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs
index 785e2fd2b..5c60e19f0 100644
--- a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs
+++ b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs
@@ -75,6 +75,7 @@ namespace MediaBrowser.Controller.Entities
public string[] Tags { get; set; }
public string[] OfficialRatings { get; set; }
+ public DateTime? MinPremiereDate { get; set; }
public DateTime? MinStartDate { get; set; }
public DateTime? MaxStartDate { get; set; }
public DateTime? MinEndDate { get; set; }
@@ -101,6 +102,9 @@ namespace MediaBrowser.Controller.Entities
public LocationType? LocationType { get; set; }
public Guid? ParentId { get; set; }
+ public string[] AncestorIds { get; set; }
+
+ public LocationType[] ExcludeLocationTypes { get; set; }
public InternalItemsQuery()
{
@@ -120,6 +124,20 @@ namespace MediaBrowser.Controller.Entities
PersonIds = new string[] { };
ChannelIds = new string[] { };
ItemIds = new string[] { };
+ AncestorIds = new string[] { };
+ ExcludeLocationTypes = new LocationType[] { };
+ }
+
+ public InternalItemsQuery(User user)
+ : this()
+ {
+ if (user != null)
+ {
+ var policy = user.Policy;
+ MaxParentalRating = policy.MaxParentalRating;
+
+ User = user;
+ }
}
}
}
diff --git a/MediaBrowser.Controller/Entities/Person.cs b/MediaBrowser.Controller/Entities/Person.cs
index 6c277da56..120a376d4 100644
--- a/MediaBrowser.Controller/Entities/Person.cs
+++ b/MediaBrowser.Controller/Entities/Person.cs
@@ -101,6 +101,15 @@ namespace MediaBrowser.Controller.Entities
return false;
}
}
+
+ [IgnoreDataMember]
+ public override bool SupportsAncestors
+ {
+ get
+ {
+ return false;
+ }
+ }
}
/// <summary>
diff --git a/MediaBrowser.Controller/Entities/Photo.cs b/MediaBrowser.Controller/Entities/Photo.cs
index a3d892181..6c2f2a326 100644
--- a/MediaBrowser.Controller/Entities/Photo.cs
+++ b/MediaBrowser.Controller/Entities/Photo.cs
@@ -9,12 +9,10 @@ namespace MediaBrowser.Controller.Entities
{
public class Photo : BaseItem, IHasTags, IHasTaglines
{
- public List<string> Tags { get; set; }
public List<string> Taglines { get; set; }
public Photo()
{
- Tags = new List<string>();
Taglines = new List<string>();
}
diff --git a/MediaBrowser.Controller/Entities/Studio.cs b/MediaBrowser.Controller/Entities/Studio.cs
index 822f305ed..a55527f37 100644
--- a/MediaBrowser.Controller/Entities/Studio.cs
+++ b/MediaBrowser.Controller/Entities/Studio.cs
@@ -10,13 +10,6 @@ namespace MediaBrowser.Controller.Entities
/// </summary>
public class Studio : BaseItem, IItemByName, IHasTags
{
- public List<string> Tags { get; set; }
-
- public Studio()
- {
- Tags = new List<string>();
- }
-
/// <summary>
/// Gets the user data key.
/// </summary>
diff --git a/MediaBrowser.Controller/Entities/TV/Episode.cs b/MediaBrowser.Controller/Entities/TV/Episode.cs
index 92ca9e970..3d18b86df 100644
--- a/MediaBrowser.Controller/Entities/TV/Episode.cs
+++ b/MediaBrowser.Controller/Entities/TV/Episode.cs
@@ -265,6 +265,20 @@ namespace MediaBrowser.Controller.Entities.TV
}
}
+ public override IEnumerable<Guid> GetAncestorIds()
+ {
+ var list = base.GetAncestorIds().ToList();
+
+ var seasonId = SeasonId;
+
+ if (seasonId.HasValue && !list.Contains(seasonId.Value))
+ {
+ list.Add(seasonId.Value);
+ }
+
+ return list;
+ }
+
public override IEnumerable<string> GetDeletePaths()
{
return new[] { Path };
diff --git a/MediaBrowser.Controller/Entities/User.cs b/MediaBrowser.Controller/Entities/User.cs
index a9e314ede..3900f0805 100644
--- a/MediaBrowser.Controller/Entities/User.cs
+++ b/MediaBrowser.Controller/Entities/User.cs
@@ -58,6 +58,26 @@ namespace MediaBrowser.Controller.Entities
}
}
+ private string _name;
+ /// <summary>
+ /// Gets or sets the name.
+ /// </summary>
+ /// <value>The name.</value>
+ public override string Name
+ {
+ get
+ {
+ return _name;
+ }
+ set
+ {
+ _name = value;
+
+ // lazy load this again
+ SortName = null;
+ }
+ }
+
/// <summary>
/// Returns the folder containing the item.
/// If the item is a folder, it returns the folder itself
diff --git a/MediaBrowser.Controller/Entities/UserRootFolder.cs b/MediaBrowser.Controller/Entities/UserRootFolder.cs
index a78beb645..e6f322595 100644
--- a/MediaBrowser.Controller/Entities/UserRootFolder.cs
+++ b/MediaBrowser.Controller/Entities/UserRootFolder.cs
@@ -55,13 +55,18 @@ namespace MediaBrowser.Controller.Entities
}
}
+ protected override IEnumerable<BaseItem> GetEligibleChildrenForRecursiveChildren(User user)
+ {
+ return base.GetEligibleChildrenForRecursiveChildren(user).Concat(LibraryManager.RootFolder.VirtualChildren);
+ }
+
/// <summary>
/// Get the children of this folder from the actual file system
/// </summary>
/// <returns>IEnumerable{BaseItem}.</returns>
protected override IEnumerable<BaseItem> GetNonCachedChildren(IDirectoryService directoryService)
{
- return base.GetNonCachedChildren(directoryService).Concat(LibraryManager.RootFolder.VirtualChildren);
+ return base.GetNonCachedChildren(directoryService);
}
public override bool BeforeMetadataRefresh()
diff --git a/MediaBrowser.Controller/Entities/UserView.cs b/MediaBrowser.Controller/Entities/UserView.cs
index 5ee49ae5a..76188ce58 100644
--- a/MediaBrowser.Controller/Entities/UserView.cs
+++ b/MediaBrowser.Controller/Entities/UserView.cs
@@ -24,6 +24,21 @@ namespace MediaBrowser.Controller.Entities
{
return true;
}
+
+ public override IEnumerable<Guid> GetIdsForAncestorQuery()
+ {
+ var list = new List<Guid>();
+
+ if (DisplayParentId != Guid.Empty)
+ {
+ list.Add(DisplayParentId);
+ }
+ else if (ParentId != Guid.Empty)
+ {
+ list.Add(ParentId);
+ }
+ return list;
+ }
public override Task<QueryResult<BaseItem>> GetItems(InternalItemsQuery query)
{
diff --git a/MediaBrowser.Controller/Entities/Video.cs b/MediaBrowser.Controller/Entities/Video.cs
index 8beee79bf..62d1bc7a1 100644
--- a/MediaBrowser.Controller/Entities/Video.cs
+++ b/MediaBrowser.Controller/Entities/Video.cs
@@ -186,12 +186,6 @@ namespace MediaBrowser.Controller.Entities
public string ShortcutPath { get; set; }
/// <summary>
- /// Gets or sets the tags.
- /// </summary>
- /// <value>The tags.</value>
- public List<string> Tags { get; set; }
-
- /// <summary>
/// Gets or sets the video bit rate.
/// </summary>
/// <value>The video bit rate.</value>
diff --git a/MediaBrowser.Controller/Library/ILibraryManager.cs b/MediaBrowser.Controller/Library/ILibraryManager.cs
index c7ab88524..9e434541a 100644
--- a/MediaBrowser.Controller/Library/ILibraryManager.cs
+++ b/MediaBrowser.Controller/Library/ILibraryManager.cs
@@ -543,5 +543,23 @@ namespace MediaBrowser.Controller.Library
/// <param name="imageIndex">Index of the image.</param>
/// <returns>Task.</returns>
Task<ItemImageInfo> ConvertImageToLocal(IHasImages item, ItemImageInfo image, int imageIndex);
+
+ /// <summary>
+ /// Gets the items.
+ /// </summary>
+ /// <param name="query">The query.</param>
+ /// <param name="user">The user.</param>
+ /// <param name="parentIds">The parent ids.</param>
+ /// <returns>List&lt;BaseItem&gt;.</returns>
+ IEnumerable<BaseItem> GetItems(InternalItemsQuery query, User user, IEnumerable<string> parentIds);
+
+ /// <summary>
+ /// Gets the items result.
+ /// </summary>
+ /// <param name="query">The query.</param>
+ /// <param name="user">The user.</param>
+ /// <param name="parentIds">The parent ids.</param>
+ /// <returns>QueryResult&lt;BaseItem&gt;.</returns>
+ QueryResult<BaseItem> GetItemsResult(InternalItemsQuery query, IEnumerable<string> parentIds);
}
} \ No newline at end of file
diff --git a/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs
index 03c05ec69..f1634a8a5 100644
--- a/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs
+++ b/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs
@@ -36,7 +36,6 @@ namespace MediaBrowser.Controller.LiveTv
public bool IsLive { get; set; }
[IgnoreDataMember]
public bool IsPremiere { get; set; }
- public ProgramAudio? Audio { get; set; }
/// <summary>
/// Gets the user data key.
@@ -140,5 +139,10 @@ namespace MediaBrowser.Controller.LiveTv
return list;
}
+
+ public override bool IsVisibleStandalone(User user)
+ {
+ return IsVisible(user);
+ }
}
}
diff --git a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs
index e4b52fd99..55bc2269e 100644
--- a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs
+++ b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs
@@ -32,10 +32,11 @@ namespace MediaBrowser.Controller.LiveTv
}
/// <summary>
- /// Gets or sets the type of the channel.
+ /// Gets or sets the name.
/// </summary>
- /// <value>The type of the channel.</value>
- public ChannelType ChannelType { get; set; }
+ /// <value>The name.</value>
+ [IgnoreDataMember]
+ public string ServiceName { get; set; }
/// <summary>
/// The start date of the program, in UTC.
@@ -44,12 +45,6 @@ namespace MediaBrowser.Controller.LiveTv
public DateTime StartDate { get; set; }
/// <summary>
- /// Gets or sets the audio.
- /// </summary>
- /// <value>The audio.</value>
- public ProgramAudio? Audio { get; set; }
-
- /// <summary>
/// Gets or sets a value indicating whether this instance is repeat.
/// </summary>
/// <value><c>true</c> if this instance is repeat; otherwise, <c>false</c>.</value>
@@ -64,12 +59,6 @@ namespace MediaBrowser.Controller.LiveTv
public string EpisodeTitle { get; set; }
/// <summary>
- /// Gets or sets the name of the service.
- /// </summary>
- /// <value>The name of the service.</value>
- public string ServiceName { get; set; }
-
- /// <summary>
/// Gets or sets a value indicating whether this instance is movie.
/// </summary>
/// <value><c>true</c> if this instance is movie; otherwise, <c>false</c>.</value>
@@ -145,14 +134,14 @@ namespace MediaBrowser.Controller.LiveTv
}
}
- [IgnoreDataMember]
- public override string MediaType
- {
- get
- {
- return ChannelType == ChannelType.TV ? Model.Entities.MediaType.Video : Model.Entities.MediaType.Audio;
- }
- }
+ //[IgnoreDataMember]
+ //public override string MediaType
+ //{
+ // get
+ // {
+ // return ChannelType == ChannelType.TV ? Model.Entities.MediaType.Video : Model.Entities.MediaType.Audio;
+ // }
+ //}
[IgnoreDataMember]
public bool IsAiring
@@ -228,5 +217,14 @@ namespace MediaBrowser.Controller.LiveTv
return base.SupportsPeople;
}
}
+
+ [IgnoreDataMember]
+ public override bool SupportsAncestors
+ {
+ get
+ {
+ return false;
+ }
+ }
}
}
diff --git a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs
index 77404cfe8..96a465201 100644
--- a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs
+++ b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs
@@ -36,7 +36,6 @@ namespace MediaBrowser.Controller.LiveTv
public bool IsLive { get; set; }
[IgnoreDataMember]
public bool IsPremiere { get; set; }
- public ProgramAudio? Audio { get; set; }
/// <summary>
/// Gets the user data key.
@@ -150,5 +149,10 @@ namespace MediaBrowser.Controller.LiveTv
return list;
}
+
+ public override bool IsVisibleStandalone(User user)
+ {
+ return IsVisible(user);
+ }
}
}
diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
index bcf4de2a2..600674114 100644
--- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj
+++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
@@ -248,6 +248,7 @@
<Compile Include="Net\IWebSocketConnection.cs" />
<Compile Include="Net\IWebSocketListener.cs" />
<Compile Include="Net\LoggedAttribute.cs" />
+ <Compile Include="Net\PaymentRequiredException.cs" />
<Compile Include="Net\SecurityException.cs" />
<Compile Include="Net\ServiceStackServiceRequest.cs" />
<Compile Include="Net\StaticResultOptions.cs" />
diff --git a/MediaBrowser.Controller/Net/PaymentRequiredException.cs b/MediaBrowser.Controller/Net/PaymentRequiredException.cs
new file mode 100644
index 000000000..e09fe092e
--- /dev/null
+++ b/MediaBrowser.Controller/Net/PaymentRequiredException.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MediaBrowser.Controller.Net
+{
+ /// <summary>
+ /// Corresponds to a 402 response code
+ /// </summary>
+ public class PaymentRequiredException : Exception
+ {
+ }
+}
diff --git a/MediaBrowser.Controller/Persistence/IItemRepository.cs b/MediaBrowser.Controller/Persistence/IItemRepository.cs
index 8fc0aedd3..0b1c9c3e0 100644
--- a/MediaBrowser.Controller/Persistence/IItemRepository.cs
+++ b/MediaBrowser.Controller/Persistence/IItemRepository.cs
@@ -176,6 +176,13 @@ namespace MediaBrowser.Controller.Persistence
/// <param name="query">The query.</param>
/// <returns>QueryResult&lt;Tuple&lt;Guid, System.String&gt;&gt;.</returns>
QueryResult<Tuple<Guid, string>> GetItemIdsWithPath(InternalItemsQuery query);
+
+ /// <summary>
+ /// Gets the item list.
+ /// </summary>
+ /// <param name="query">The query.</param>
+ /// <returns>List&lt;BaseItem&gt;.</returns>
+ IEnumerable<BaseItem> GetItemList(InternalItemsQuery query);
}
}
diff --git a/MediaBrowser.Controller/Providers/MetadataStatus.cs b/MediaBrowser.Controller/Providers/MetadataStatus.cs
index 9b946aee2..654d72e2a 100644
--- a/MediaBrowser.Controller/Providers/MetadataStatus.cs
+++ b/MediaBrowser.Controller/Providers/MetadataStatus.cs
@@ -40,22 +40,8 @@ namespace MediaBrowser.Controller.Providers
/// <value>The date last images refresh.</value>
public DateTime? DateLastImagesRefresh { get; set; }
- /// <summary>
- /// Gets or sets the last result error message.
- /// </summary>
- /// <value>The last result error message.</value>
- public string LastErrorMessage { get; set; }
-
public DateTime? ItemDateModified { get; set; }
- public void AddStatus(string errorMessage)
- {
- if (string.IsNullOrEmpty(LastErrorMessage))
- {
- LastErrorMessage = errorMessage;
- }
- }
-
public bool IsDirty { get; private set; }
public void SetDateLastMetadataRefresh(DateTime? date)