aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Channels
diff options
context:
space:
mode:
authorTim Hobbs <jesus.tesh@gmail.com>2014-05-18 15:45:16 -0700
committerTim Hobbs <jesus.tesh@gmail.com>2014-05-18 15:45:16 -0700
commit6e1082563173b6b71b96fc8e38ff974f49c07add (patch)
treeebdf2c12344afd856c040b8396b288dc6be8f8e2 /MediaBrowser.Controller/Channels
parent0bf6fdb5a4050f30ac8100210a9fe9e2a48f63e2 (diff)
parent708d5a416ed373c158b3dc45952a1fd123fb74e8 (diff)
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser into upstream-master
Diffstat (limited to 'MediaBrowser.Controller/Channels')
-rw-r--r--MediaBrowser.Controller/Channels/Channel.cs2
-rw-r--r--MediaBrowser.Controller/Channels/ChannelAudioItem.cs26
-rw-r--r--MediaBrowser.Controller/Channels/ChannelCategoryItem.cs9
-rw-r--r--MediaBrowser.Controller/Channels/ChannelItemInfo.cs2
-rw-r--r--MediaBrowser.Controller/Channels/ChannelMediaInfo.cs3
-rw-r--r--MediaBrowser.Controller/Channels/ChannelVideoItem.cs21
-rw-r--r--MediaBrowser.Controller/Channels/IChannel.cs17
-rw-r--r--MediaBrowser.Controller/Channels/IChannelItem.cs2
-rw-r--r--MediaBrowser.Controller/Channels/IChannelManager.cs8
-rw-r--r--MediaBrowser.Controller/Channels/IChannelMediaItem.cs6
10 files changed, 90 insertions, 6 deletions
diff --git a/MediaBrowser.Controller/Channels/Channel.cs b/MediaBrowser.Controller/Channels/Channel.cs
index b894893c6c..3d9d0d381d 100644
--- a/MediaBrowser.Controller/Channels/Channel.cs
+++ b/MediaBrowser.Controller/Channels/Channel.cs
@@ -10,7 +10,7 @@ namespace MediaBrowser.Controller.Channels
public override bool IsVisible(User user)
{
- if (user.Configuration.BlockedChannels.Contains(Name, StringComparer.OrdinalIgnoreCase))
+ if (user.Configuration.BlockedChannels.Contains(Id.ToString("N"), StringComparer.OrdinalIgnoreCase))
{
return false;
}
diff --git a/MediaBrowser.Controller/Channels/ChannelAudioItem.cs b/MediaBrowser.Controller/Channels/ChannelAudioItem.cs
index 72a996b193..6d32f7d356 100644
--- a/MediaBrowser.Controller/Channels/ChannelAudioItem.cs
+++ b/MediaBrowser.Controller/Channels/ChannelAudioItem.cs
@@ -1,6 +1,8 @@
-using System.Linq;
-using MediaBrowser.Controller.Entities.Audio;
+using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Model.Configuration;
+using MediaBrowser.Model.Entities;
+using System.Collections.Generic;
+using System.Linq;
namespace MediaBrowser.Controller.Channels
{
@@ -18,6 +20,8 @@ namespace MediaBrowser.Controller.Channels
public string OriginalImageUrl { get; set; }
+ public List<ChannelMediaInfo> ChannelMediaSources { get; set; }
+
protected override bool GetBlockUnratedValue(UserConfiguration config)
{
return config.BlockUnratedItems.Contains(UnratedItem.ChannelContent);
@@ -30,5 +34,23 @@ namespace MediaBrowser.Controller.Channels
return false;
}
}
+
+ public ChannelAudioItem()
+ {
+ ChannelMediaSources = new List<ChannelMediaInfo>();
+ }
+
+ public override LocationType LocationType
+ {
+ get
+ {
+ if (string.IsNullOrEmpty(Path))
+ {
+ return LocationType.Remote;
+ }
+
+ return base.LocationType;
+ }
+ }
}
}
diff --git a/MediaBrowser.Controller/Channels/ChannelCategoryItem.cs b/MediaBrowser.Controller/Channels/ChannelCategoryItem.cs
index b20dcf6204..c18f748563 100644
--- a/MediaBrowser.Controller/Channels/ChannelCategoryItem.cs
+++ b/MediaBrowser.Controller/Channels/ChannelCategoryItem.cs
@@ -1,5 +1,6 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Configuration;
+using System.Collections.Generic;
namespace MediaBrowser.Controller.Channels
{
@@ -8,10 +9,11 @@ namespace MediaBrowser.Controller.Channels
public string ExternalId { get; set; }
public string ChannelId { get; set; }
-
+
public ChannelItemType ChannelItemType { get; set; }
public string OriginalImageUrl { get; set; }
+ public List<string> Tags { get; set; }
protected override bool GetBlockUnratedValue(UserConfiguration config)
{
@@ -26,5 +28,10 @@ namespace MediaBrowser.Controller.Channels
return false;
}
}
+
+ public ChannelCategoryItem()
+ {
+ Tags = new List<string>();
+ }
}
}
diff --git a/MediaBrowser.Controller/Channels/ChannelItemInfo.cs b/MediaBrowser.Controller/Channels/ChannelItemInfo.cs
index 7bb8d15fc3..948754e49e 100644
--- a/MediaBrowser.Controller/Channels/ChannelItemInfo.cs
+++ b/MediaBrowser.Controller/Channels/ChannelItemInfo.cs
@@ -19,6 +19,7 @@ namespace MediaBrowser.Controller.Channels
public List<string> Genres { get; set; }
public List<string> Studios { get; set; }
+ public List<string> Tags { get; set; }
public List<PersonInfo> People { get; set; }
@@ -49,6 +50,7 @@ namespace MediaBrowser.Controller.Channels
Genres = new List<string>();
Studios = new List<string>();
People = new List<PersonInfo>();
+ Tags = new List<string>();
ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
}
}
diff --git a/MediaBrowser.Controller/Channels/ChannelMediaInfo.cs b/MediaBrowser.Controller/Channels/ChannelMediaInfo.cs
index 8105bf43cd..3630342679 100644
--- a/MediaBrowser.Controller/Channels/ChannelMediaInfo.cs
+++ b/MediaBrowser.Controller/Channels/ChannelMediaInfo.cs
@@ -18,9 +18,12 @@ namespace MediaBrowser.Controller.Channels
public int? Height { get; set; }
public int? AudioChannels { get; set; }
+ public bool IsRemote { get; set; }
+
public ChannelMediaInfo()
{
RequiredHttpHeaders = new Dictionary<string, string>();
+ IsRemote = true;
}
}
} \ No newline at end of file
diff --git a/MediaBrowser.Controller/Channels/ChannelVideoItem.cs b/MediaBrowser.Controller/Channels/ChannelVideoItem.cs
index 0d2bd933be..01438bfad6 100644
--- a/MediaBrowser.Controller/Channels/ChannelVideoItem.cs
+++ b/MediaBrowser.Controller/Channels/ChannelVideoItem.cs
@@ -1,6 +1,7 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Entities;
+using System.Collections.Generic;
using System.Globalization;
using System.Linq;
@@ -20,6 +21,8 @@ namespace MediaBrowser.Controller.Channels
public string OriginalImageUrl { get; set; }
+ public List<ChannelMediaInfo> ChannelMediaSources { get; set; }
+
public override string GetUserDataKey()
{
if (ContentType == ChannelMediaContentType.Trailer)
@@ -55,5 +58,23 @@ namespace MediaBrowser.Controller.Channels
return false;
}
}
+
+ public ChannelVideoItem()
+ {
+ ChannelMediaSources = new List<ChannelMediaInfo>();
+ }
+
+ public override LocationType LocationType
+ {
+ get
+ {
+ if (string.IsNullOrEmpty(Path))
+ {
+ return LocationType.Remote;
+ }
+
+ return base.LocationType;
+ }
+ }
}
}
diff --git a/MediaBrowser.Controller/Channels/IChannel.cs b/MediaBrowser.Controller/Channels/IChannel.cs
index bd0bd64ea6..85744119ca 100644
--- a/MediaBrowser.Controller/Channels/IChannel.cs
+++ b/MediaBrowser.Controller/Channels/IChannel.cs
@@ -16,6 +16,12 @@ namespace MediaBrowser.Controller.Channels
string Name { get; }
/// <summary>
+ /// Gets the data version.
+ /// </summary>
+ /// <value>The data version.</value>
+ string DataVersion { get; }
+
+ /// <summary>
/// Gets the channel information.
/// </summary>
/// <returns>ChannelInfo.</returns>
@@ -59,4 +65,15 @@ namespace MediaBrowser.Controller.Channels
/// <returns>IEnumerable{ImageType}.</returns>
IEnumerable<ImageType> GetSupportedChannelImages();
}
+
+ public interface IRequiresMediaInfoCallback
+ {
+ /// <summary>
+ /// Gets the channel item media information.
+ /// </summary>
+ /// <param name="id">The identifier.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>Task{IEnumerable{ChannelMediaInfo}}.</returns>
+ Task<IEnumerable<ChannelMediaInfo>> GetChannelItemMediaInfo(string id, CancellationToken cancellationToken);
+ }
}
diff --git a/MediaBrowser.Controller/Channels/IChannelItem.cs b/MediaBrowser.Controller/Channels/IChannelItem.cs
index fc088b8886..8b97701138 100644
--- a/MediaBrowser.Controller/Channels/IChannelItem.cs
+++ b/MediaBrowser.Controller/Channels/IChannelItem.cs
@@ -2,7 +2,7 @@
namespace MediaBrowser.Controller.Channels
{
- public interface IChannelItem : IHasImages
+ public interface IChannelItem : IHasImages, IHasTags
{
string ChannelId { get; set; }
diff --git a/MediaBrowser.Controller/Channels/IChannelManager.cs b/MediaBrowser.Controller/Channels/IChannelManager.cs
index 05f9afcf00..a47f6e6aee 100644
--- a/MediaBrowser.Controller/Channels/IChannelManager.cs
+++ b/MediaBrowser.Controller/Channels/IChannelManager.cs
@@ -31,5 +31,13 @@ namespace MediaBrowser.Controller.Channels
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{QueryResult{BaseItemDto}}.</returns>
Task<QueryResult<BaseItemDto>> GetChannelItems(ChannelItemQuery query, CancellationToken cancellationToken);
+
+ /// <summary>
+ /// Gets the channel item media sources.
+ /// </summary>
+ /// <param name="id">The identifier.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>Task{IEnumerable{ChannelMediaInfo}}.</returns>
+ Task<IEnumerable<ChannelMediaInfo>> GetChannelItemMediaSources(string id, CancellationToken cancellationToken);
}
}
diff --git a/MediaBrowser.Controller/Channels/IChannelMediaItem.cs b/MediaBrowser.Controller/Channels/IChannelMediaItem.cs
index 3a2c076e0a..1e634027f0 100644
--- a/MediaBrowser.Controller/Channels/IChannelMediaItem.cs
+++ b/MediaBrowser.Controller/Channels/IChannelMediaItem.cs
@@ -1,9 +1,13 @@
-namespace MediaBrowser.Controller.Channels
+using System.Collections.Generic;
+
+namespace MediaBrowser.Controller.Channels
{
public interface IChannelMediaItem : IChannelItem
{
bool IsInfiniteStream { get; set; }
ChannelMediaContentType ContentType { get; set; }
+
+ List<ChannelMediaInfo> ChannelMediaSources { get; set; }
}
} \ No newline at end of file