aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-11-24 15:51:45 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-11-24 15:51:45 -0500
commit7b6819846d464c9e67335cfb6ab230702eb6ba1d (patch)
tree59eca1ce1190898d7c09b332139fdd57b43d3e4e /MediaBrowser.Controller
parenta99a10c02bbf34b9745a5170e3c468216de649bd (diff)
updated live tv + nuget
Diffstat (limited to 'MediaBrowser.Controller')
-rw-r--r--MediaBrowser.Controller/Entities/Genre.cs4
-rw-r--r--MediaBrowser.Controller/LiveTv/Channel.cs65
-rw-r--r--MediaBrowser.Controller/LiveTv/ILiveTvManager.cs24
-rw-r--r--MediaBrowser.Controller/LiveTv/ILiveTvService.cs6
-rw-r--r--MediaBrowser.Controller/MediaBrowser.Controller.csproj1
5 files changed, 90 insertions, 10 deletions
diff --git a/MediaBrowser.Controller/Entities/Genre.cs b/MediaBrowser.Controller/Entities/Genre.cs
index 71fa05720..6c4950182 100644
--- a/MediaBrowser.Controller/Entities/Genre.cs
+++ b/MediaBrowser.Controller/Entities/Genre.cs
@@ -1,7 +1,7 @@
-using System.Runtime.Serialization;
-using MediaBrowser.Model.Dto;
+using MediaBrowser.Model.Dto;
using System;
using System.Collections.Generic;
+using System.Runtime.Serialization;
namespace MediaBrowser.Controller.Entities
{
diff --git a/MediaBrowser.Controller/LiveTv/Channel.cs b/MediaBrowser.Controller/LiveTv/Channel.cs
new file mode 100644
index 000000000..26245e6fb
--- /dev/null
+++ b/MediaBrowser.Controller/LiveTv/Channel.cs
@@ -0,0 +1,65 @@
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Model.Dto;
+using MediaBrowser.Model.LiveTv;
+using System;
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+
+namespace MediaBrowser.Controller.LiveTv
+{
+ public class Channel : BaseItem, IItemByName
+ {
+ public Channel()
+ {
+ UserItemCounts = new Dictionary<Guid, ItemByNameCounts>();
+ }
+
+ /// <summary>
+ /// Gets the user data key.
+ /// </summary>
+ /// <returns>System.String.</returns>
+ public override string GetUserDataKey()
+ {
+ return "Channel-" + Name;
+ }
+
+ [IgnoreDataMember]
+ public Dictionary<Guid, ItemByNameCounts> UserItemCounts { get; set; }
+
+ /// <summary>
+ /// Gets or sets the number.
+ /// </summary>
+ /// <value>The number.</value>
+ public string ChannelNumber { get; set; }
+
+ /// <summary>
+ /// Get or sets the Id.
+ /// </summary>
+ /// <value>The id of the channel.</value>
+ public string ChannelId { 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 the type of the channel.
+ /// </summary>
+ /// <value>The type of the channel.</value>
+ public ChannelType ChannelType { get; set; }
+
+ protected override string CreateSortName()
+ {
+ double number = 0;
+
+ if (!string.IsNullOrEmpty(ChannelNumber))
+ {
+ double.TryParse(ChannelNumber, out number);
+ }
+
+ return number.ToString("000-") + (Name ?? string.Empty);
+ }
+ }
+}
diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
index 62bfdf3e5..8535ac996 100644
--- a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
+++ b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
@@ -1,5 +1,4 @@
-using System.Threading.Tasks;
-using MediaBrowser.Model.LiveTv;
+using MediaBrowser.Model.LiveTv;
using System.Collections.Generic;
namespace MediaBrowser.Controller.LiveTv
@@ -22,10 +21,25 @@ namespace MediaBrowser.Controller.LiveTv
void AddParts(IEnumerable<ILiveTvService> services);
/// <summary>
- /// Gets the channel info dto.
+ /// Gets the channels.
/// </summary>
- /// <param name="info">The info.</param>
+ /// <param name="query">The query.</param>
+ /// <returns>IEnumerable{Channel}.</returns>
+ IEnumerable<Channel> GetChannels(ChannelQuery query);
+
+ /// <summary>
+ /// Gets the channel information dto.
+ /// </summary>
+ /// <param name="info">The information.</param>
/// <returns>ChannelInfoDto.</returns>
- ChannelInfoDto GetChannelInfoDto(ChannelInfo info);
+ ChannelInfoDto GetChannelInfoDto(Channel info);
+
+ /// <summary>
+ /// Gets the channel.
+ /// </summary>
+ /// <param name="serviceName">Name of the service.</param>
+ /// <param name="channelId">The channel identifier.</param>
+ /// <returns>Channel.</returns>
+ Channel GetChannel(string serviceName, string channelId);
}
}
diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs
index 03584240e..56d98d518 100644
--- a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs
+++ b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs
@@ -1,6 +1,6 @@
-using System;
-using System.IO;
+using MediaBrowser.Common.Net;
using MediaBrowser.Model.LiveTv;
+using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
@@ -50,7 +50,7 @@ namespace MediaBrowser.Controller.LiveTv
/// <param name="channelId">The channel identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{Stream}.</returns>
- Task<Stream> GetChannelImageAsync(string channelId, CancellationToken cancellationToken);
+ Task<HttpResponseInfo> GetChannelImageAsync(string channelId, CancellationToken cancellationToken);
/// <summary>
/// Gets the recordings asynchronous.
diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
index 393107f1e..ea227349e 100644
--- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj
+++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
@@ -104,6 +104,7 @@
<Compile Include="Library\ItemUpdateType.cs" />
<Compile Include="Library\IUserDataManager.cs" />
<Compile Include="Library\UserDataSaveEventArgs.cs" />
+ <Compile Include="LiveTv\Channel.cs" />
<Compile Include="LiveTv\ChannelInfo.cs" />
<Compile Include="LiveTv\ILiveTvManager.cs" />
<Compile Include="LiveTv\ILiveTvService.cs" />