aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-05-27 13:09:48 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-05-27 13:09:48 -0400
commit680ffeebf7bc4b5f07daa360ba4b89526cd2db9f (patch)
tree6871c5f64731539aaeee14ac3f8f6d97b807f6ee
parent4c87979cac4df6560145b96d440aeba967466951 (diff)
updated nuget
-rw-r--r--MediaBrowser.Api/ChannelService.cs18
-rw-r--r--MediaBrowser.Controller/Channels/ChannelFolderItem.cs2
-rw-r--r--MediaBrowser.Controller/Channels/ChannelItemInfo.cs1
-rw-r--r--MediaBrowser.Controller/Channels/IChannel.cs8
-rw-r--r--MediaBrowser.Controller/Channels/IChannelManager.cs7
-rw-r--r--MediaBrowser.Model/Channels/ChannelFeatures.cs34
-rw-r--r--MediaBrowser.Model/Channels/ChannelMediaType.cs9
-rw-r--r--MediaBrowser.Server.Implementations/Channels/ChannelManager.cs11
-rw-r--r--Nuget/MediaBrowser.Common.Internal.nuspec4
-rw-r--r--Nuget/MediaBrowser.Common.nuspec2
-rw-r--r--Nuget/MediaBrowser.Server.Core.nuspec4
11 files changed, 79 insertions, 21 deletions
diff --git a/MediaBrowser.Api/ChannelService.cs b/MediaBrowser.Api/ChannelService.cs
index bc3c11374..2a2d316d3 100644
--- a/MediaBrowser.Api/ChannelService.cs
+++ b/MediaBrowser.Api/ChannelService.cs
@@ -36,18 +36,27 @@ namespace MediaBrowser.Api
public int? Limit { get; set; }
}
+ [Route("/Channels/{Id}/Features", "GET", Summary = "Gets features for a channel")]
+ public class GetChannelFeatures : IReturn<ChannelFeatures>
+ {
+ [ApiMember(Name = "Id", Description = "Channel Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
+ public string Id { get; set; }
+ }
+
[Route("/Channels/{Id}/Items", "GET", Summary = "Gets channel items")]
public class GetChannelItems : IReturn<QueryResult<BaseItemDto>>
{
+ [ApiMember(Name = "Id", Description = "Channel Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
public string Id { get; set; }
+ [ApiMember(Name = "FolderId", Description = "Folder Id", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public string FolderId { get; set; }
/// <summary>
/// Gets or sets the user id.
/// </summary>
/// <value>The user id.</value>
- [ApiMember(Name = "UserId", Description = "User Id", IsRequired = false, DataType = "string", ParameterType = "path", Verb = "GET")]
+ [ApiMember(Name = "UserId", Description = "User Id", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public string UserId { get; set; }
/// <summary>
@@ -99,6 +108,13 @@ namespace MediaBrowser.Api
_channelManager = channelManager;
}
+ public object Get(GetChannelFeatures request)
+ {
+ var result = _channelManager.GetChannelFeatures(request.Id);
+
+ return ToOptimizedResult(result);
+ }
+
public object Get(GetChannels request)
{
var result = _channelManager.GetChannels(new ChannelQuery
diff --git a/MediaBrowser.Controller/Channels/ChannelFolderItem.cs b/MediaBrowser.Controller/Channels/ChannelFolderItem.cs
index 3b66e52ce..5be30d7c3 100644
--- a/MediaBrowser.Controller/Channels/ChannelFolderItem.cs
+++ b/MediaBrowser.Controller/Channels/ChannelFolderItem.cs
@@ -1,4 +1,5 @@
using MediaBrowser.Controller.Entities;
+using MediaBrowser.Model.Channels;
using MediaBrowser.Model.Configuration;
using System.Collections.Generic;
@@ -11,6 +12,7 @@ namespace MediaBrowser.Controller.Channels
public string ChannelId { get; set; }
public ChannelItemType ChannelItemType { get; set; }
+ public ChannelFolderType ChannelFolderType { get; set; }
public string OriginalImageUrl { get; set; }
public List<string> Tags { get; set; }
diff --git a/MediaBrowser.Controller/Channels/ChannelItemInfo.cs b/MediaBrowser.Controller/Channels/ChannelItemInfo.cs
index 66718d7cd..707807bd5 100644
--- a/MediaBrowser.Controller/Channels/ChannelItemInfo.cs
+++ b/MediaBrowser.Controller/Channels/ChannelItemInfo.cs
@@ -33,6 +33,7 @@ namespace MediaBrowser.Controller.Channels
public string ImageUrl { get; set; }
public ChannelMediaType MediaType { get; set; }
+ public ChannelFolderType FolderType { get; set; }
public ChannelMediaContentType ContentType { get; set; }
diff --git a/MediaBrowser.Controller/Channels/IChannel.cs b/MediaBrowser.Controller/Channels/IChannel.cs
index 7f03579f3..799df9182 100644
--- a/MediaBrowser.Controller/Channels/IChannel.cs
+++ b/MediaBrowser.Controller/Channels/IChannel.cs
@@ -59,14 +59,6 @@ namespace MediaBrowser.Controller.Channels
Task<ChannelItemResult> GetChannelItems(InternalChannelItemQuery query, CancellationToken cancellationToken);
/// <summary>
- /// Gets all media.
- /// </summary>
- /// <param name="query">The query.</param>
- /// <param name="cancellationToken">The cancellation token.</param>
- /// <returns>Task{ChannelItemResult}.</returns>
- Task<ChannelItemResult> GetAllMedia(InternalAllChannelItemsQuery query, CancellationToken cancellationToken);
-
- /// <summary>
/// Gets the channel image.
/// </summary>
/// <param name="type">The type.</param>
diff --git a/MediaBrowser.Controller/Channels/IChannelManager.cs b/MediaBrowser.Controller/Channels/IChannelManager.cs
index 9ffe43827..4c2d665e5 100644
--- a/MediaBrowser.Controller/Channels/IChannelManager.cs
+++ b/MediaBrowser.Controller/Channels/IChannelManager.cs
@@ -17,6 +17,13 @@ namespace MediaBrowser.Controller.Channels
void AddParts(IEnumerable<IChannel> channels, IEnumerable<IChannelFactory> factories);
/// <summary>
+ /// Gets the channel features.
+ /// </summary>
+ /// <param name="id">The identifier.</param>
+ /// <returns>ChannelFeatures.</returns>
+ ChannelFeatures GetChannelFeatures(string id);
+
+ /// <summary>
/// Gets the channel.
/// </summary>
/// <param name="id">The identifier.</param>
diff --git a/MediaBrowser.Model/Channels/ChannelFeatures.cs b/MediaBrowser.Model/Channels/ChannelFeatures.cs
index dbfab87db..d3af8dadf 100644
--- a/MediaBrowser.Model/Channels/ChannelFeatures.cs
+++ b/MediaBrowser.Model/Channels/ChannelFeatures.cs
@@ -11,12 +11,6 @@ namespace MediaBrowser.Model.Channels
public bool CanSearch { get; set; }
/// <summary>
- /// Gets or sets a value indicating whether this instance can index all media.
- /// </summary>
- /// <value><c>true</c> if this instance can index all media; otherwise, <c>false</c>.</value>
- public bool CanGetAllMedia { get; set; }
-
- /// <summary>
/// Gets or sets the media types.
/// </summary>
/// <value>The media types.</value>
@@ -33,11 +27,39 @@ namespace MediaBrowser.Model.Channels
/// </summary>
public int? MaxPageSize { get; set; }
+ /// <summary>
+ /// Gets or sets the default sort orders.
+ /// </summary>
+ /// <value>The default sort orders.</value>
+ public List<ChannelItemSortField> DefaultSortFields { get; set; }
+
+ /// <summary>
+ /// Indicates if a sort ascending/descending toggle is supported or not.
+ /// </summary>
+ public bool SupportsSortOrderToggle { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the channel content is just a single media list.
+ /// </summary>
+ /// <value><c>true</c> if this instance is single media list; otherwise, <c>false</c>.</value>
+ public bool IsSingleMediaList { get; set; }
+
public ChannelFeatures()
{
MediaTypes = new List<ChannelMediaType>();
ContentTypes = new List<ChannelMediaContentType>();
+
+ DefaultSortFields = new List<ChannelItemSortField>();
}
}
+ public enum ChannelItemSortField
+ {
+ Name = 0,
+ CommunityRating = 1,
+ ReleaseDate = 2,
+ Runtime = 3,
+ CommunityMostWatched = 4,
+ UserPlayCount = 5
+ }
}
diff --git a/MediaBrowser.Model/Channels/ChannelMediaType.cs b/MediaBrowser.Model/Channels/ChannelMediaType.cs
index 102cb6644..cf3239c9b 100644
--- a/MediaBrowser.Model/Channels/ChannelMediaType.cs
+++ b/MediaBrowser.Model/Channels/ChannelMediaType.cs
@@ -8,4 +8,13 @@
Photo = 2
}
+
+ public enum ChannelFolderType
+ {
+ Container = 0,
+
+ MusicAlbum = 1,
+
+ PhotoAlbum = 2
+ }
} \ No newline at end of file
diff --git a/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs b/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs
index 355ac43fc..572db8332 100644
--- a/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs
+++ b/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs
@@ -237,6 +237,15 @@ namespace MediaBrowser.Server.Implementations.Channels
return (Channel)_libraryManager.GetItemById(new Guid(id));
}
+ public ChannelFeatures GetChannelFeatures(string id)
+ {
+ var channel = GetChannel(id);
+
+ var channelProvider = GetChannelProvider(channel);
+
+ return channelProvider.GetChannelFeatures();
+ }
+
private Guid GetInternalChannelId(string name)
{
if (string.IsNullOrWhiteSpace(name))
@@ -267,7 +276,7 @@ namespace MediaBrowser.Server.Implementations.Channels
if (query.Limit.HasValue && query.Limit.Value > channelInfo.MaxPageSize.Value)
{
- throw new ArgumentException(string.Format("Channel {0} only supports a maximum of {1} records at a time.", channel.Name, channelInfo.MaxPageSize.Value));
+ throw new ArgumentException(string.Format("{0} channel only supports a maximum of {1} records at a time.", channel.Name, channelInfo.MaxPageSize.Value));
}
providerLimit = query.Limit;
}
diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspec
index 2f54f7952..faa86f775 100644
--- a/Nuget/MediaBrowser.Common.Internal.nuspec
+++ b/Nuget/MediaBrowser.Common.Internal.nuspec
@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MediaBrowser.Common.Internal</id>
- <version>3.0.378</version>
+ <version>3.0.382</version>
<title>MediaBrowser.Common.Internal</title>
<authors>Luke</authors>
<owners>ebr,Luke,scottisafool</owners>
@@ -12,7 +12,7 @@
<description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description>
<copyright>Copyright © Media Browser 2013</copyright>
<dependencies>
- <dependency id="MediaBrowser.Common" version="3.0.378" />
+ <dependency id="MediaBrowser.Common" version="3.0.382" />
<dependency id="NLog" version="2.1.0" />
<dependency id="SimpleInjector" version="2.5.0" />
<dependency id="sharpcompress" version="0.10.2" />
diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec
index 4155976b4..cb59c7afa 100644
--- a/Nuget/MediaBrowser.Common.nuspec
+++ b/Nuget/MediaBrowser.Common.nuspec
@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MediaBrowser.Common</id>
- <version>3.0.378</version>
+ <version>3.0.382</version>
<title>MediaBrowser.Common</title>
<authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners>
diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec
index 38111ed1a..bfb9a547a 100644
--- a/Nuget/MediaBrowser.Server.Core.nuspec
+++ b/Nuget/MediaBrowser.Server.Core.nuspec
@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>MediaBrowser.Server.Core</id>
- <version>3.0.378</version>
+ <version>3.0.382</version>
<title>Media Browser.Server.Core</title>
<authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners>
@@ -12,7 +12,7 @@
<description>Contains core components required to build plugins for Media Browser Server.</description>
<copyright>Copyright © Media Browser 2013</copyright>
<dependencies>
- <dependency id="MediaBrowser.Common" version="3.0.378" />
+ <dependency id="MediaBrowser.Common" version="3.0.382" />
</dependencies>
</metadata>
<files>