aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MediaBrowser.Api/LiveTv/LiveTvService.cs31
-rw-r--r--MediaBrowser.Controller/LiveTv/ChannelInfo.cs6
-rw-r--r--MediaBrowser.Controller/LiveTv/ILiveTvManager.cs2
-rw-r--r--MediaBrowser.Controller/LiveTv/ILiveTvService.cs11
-rw-r--r--MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj15
-rw-r--r--MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj15
-rw-r--r--MediaBrowser.Model/LiveTv/ChannelInfoDto.cs10
-rw-r--r--MediaBrowser.Model/LiveTv/EpgFullInfo.cs17
-rw-r--r--MediaBrowser.Model/LiveTv/EpgInfo.cs37
-rw-r--r--MediaBrowser.Model/MediaBrowser.Model.csproj5
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs8
11 files changed, 63 insertions, 94 deletions
diff --git a/MediaBrowser.Api/LiveTv/LiveTvService.cs b/MediaBrowser.Api/LiveTv/LiveTvService.cs
index 6c3fcbac1..72e5eee92 100644
--- a/MediaBrowser.Api/LiveTv/LiveTvService.cs
+++ b/MediaBrowser.Api/LiveTv/LiveTvService.cs
@@ -32,17 +32,17 @@ namespace MediaBrowser.Api.LiveTv
public string ServiceName { get; set; }
}
- [Route("/LiveTv/EPG", "GET")]
+ [Route("/LiveTv/Guide", "GET")]
[Api(Description = "Gets available live tv epgs..")]
- public class GetEpg : IReturn<EpgFullInfo>
+ public class GetGuide : IReturn<List<ChannelGuide>>
{
- [ApiMember(Name = "ServiceName", Description = "The live tv service name", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "GET")]
+ [ApiMember(Name = "ServiceName", Description = "Live tv service name", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "GET")]
public string ServiceName { get; set; }
- [ApiMember(Name = "ChannelId", Description = "The channel id", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "GET")]
- public string ChannelId { get; set; }
+ [ApiMember(Name = "ChannelIds", Description = "The channels to return guide information for.", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "GET")]
+ public string ChannelIds { get; set; }
}
-
+
public class LiveTvService : BaseApiService
{
private readonly ILiveTvManager _liveTvManager;
@@ -112,28 +112,33 @@ namespace MediaBrowser.Api.LiveTv
{
var services = GetServices(request.ServiceName);
- var tasks = services.Select(i => i.GetRecordingsAsync(CancellationToken.None));
+ var query = new RecordingQuery
+ {
+
+ };
+
+ var tasks = services.Select(i => i.GetRecordingsAsync(query, CancellationToken.None));
var recordings = await Task.WhenAll(tasks).ConfigureAwait(false);
- return recordings.SelectMany(i => i).Select(_liveTvManager.GetRecordingInfo);
+ return recordings.SelectMany(i => i);
}
- public object Get(GetEpg request)
+ public object Get(GetGuide request)
{
- var result = GetEpgAsync(request).Result;
+ var result = GetGuideAsync(request).Result;
return ToOptimizedResult(result);
}
- private async Task<EpgFullInfo> GetEpgAsync(GetEpg request)
+ private async Task<IEnumerable<ChannelGuide>> GetGuideAsync(GetGuide request)
{
var service = GetServices(request.ServiceName)
.First();
- var epg = await service.GetEpgAsync(request.ChannelId, CancellationToken.None).ConfigureAwait(false);
+ var channels = request.ChannelIds.Split(',');
- return epg;
+ return await service.GetChannelGuidesAsync(channels, CancellationToken.None).ConfigureAwait(false);
}
}
} \ No newline at end of file
diff --git a/MediaBrowser.Controller/LiveTv/ChannelInfo.cs b/MediaBrowser.Controller/LiveTv/ChannelInfo.cs
index 8d8b63847..721c1e40a 100644
--- a/MediaBrowser.Controller/LiveTv/ChannelInfo.cs
+++ b/MediaBrowser.Controller/LiveTv/ChannelInfo.cs
@@ -14,6 +14,12 @@ namespace MediaBrowser.Controller.LiveTv
public string Name { get; set; }
/// <summary>
+ /// Gets or sets the number.
+ /// </summary>
+ /// <value>The number.</value>
+ public string Number { get; set; }
+
+ /// <summary>
/// Get or sets the Id.
/// </summary>
/// <value>The id of the channel.</value>
diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
index a48a6a551..62bfdf3e5 100644
--- a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
+++ b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
@@ -27,7 +27,5 @@ namespace MediaBrowser.Controller.LiveTv
/// <param name="info">The info.</param>
/// <returns>ChannelInfoDto.</returns>
ChannelInfoDto GetChannelInfoDto(ChannelInfo info);
-
- RecordingInfo GetRecordingInfo(RecordingInfo info);
}
}
diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs
index 8cad0bd35..5c019ae8c 100644
--- a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs
+++ b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs
@@ -26,16 +26,17 @@ namespace MediaBrowser.Controller.LiveTv
/// <summary>
/// Gets the recordings asynchronous.
/// </summary>
+ /// <param name="query">The query.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{IEnumerable{RecordingInfo}}.</returns>
- Task<IEnumerable<RecordingInfo>> GetRecordingsAsync(CancellationToken cancellationToken);
+ Task<IEnumerable<RecordingInfo>> GetRecordingsAsync(RecordingQuery query, CancellationToken cancellationToken);
/// <summary>
- /// Gets the epg asynchronous.
+ /// Gets the channel guides.
/// </summary>
- /// <param name="channelId">The channel identifier.</param>
+ /// <param name="channelIdList">The channel identifier list.</param>
/// <param name="cancellationToken">The cancellation token.</param>
- /// <returns>Task{EpgFullInfo}.</returns>
- Task<EpgFullInfo> GetEpgAsync(string channelId, CancellationToken cancellationToken);
+ /// <returns>Task{IEnumerable{ChannelGuide}}.</returns>
+ Task<IEnumerable<ChannelGuide>> GetChannelGuidesAsync(IEnumerable<string> channelIdList, CancellationToken cancellationToken);
}
}
diff --git a/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj b/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj
index a5bff2b40..726df1eb5 100644
--- a/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj
+++ b/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj
@@ -224,24 +224,27 @@
<Compile Include="..\MediaBrowser.Model\IO\IZipClient.cs">
<Link>IO\IZipClient.cs</Link>
</Compile>
+ <Compile Include="..\MediaBrowser.Model\LiveTv\ChannelGuide.cs">
+ <Link>LiveTv\ChannelGuide.cs</Link>
+ </Compile>
<Compile Include="..\MediaBrowser.Model\LiveTv\ChannelInfoDto.cs">
<Link>LiveTv\ChannelInfoDto.cs</Link>
</Compile>
<Compile Include="..\MediaBrowser.Model\LiveTv\ChannelType.cs">
<Link>LiveTv\ChannelType.cs</Link>
</Compile>
- <Compile Include="..\MediaBrowser.Model\LiveTv\EpgFullInfo.cs">
- <Link>LiveTv\EpgFullInfo.cs</Link>
- </Compile>
- <Compile Include="..\MediaBrowser.Model\LiveTv\EpgInfo.cs">
- <Link>LiveTv\EpgInfo.cs</Link>
- </Compile>
<Compile Include="..\MediaBrowser.Model\LiveTv\LiveTvServiceInfo.cs">
<Link>LiveTv\LiveTvServiceInfo.cs</Link>
</Compile>
+ <Compile Include="..\MediaBrowser.Model\LiveTv\ProgramInfo.cs">
+ <Link>LiveTv\ProgramInfo.cs</Link>
+ </Compile>
<Compile Include="..\MediaBrowser.Model\LiveTv\RecordingInfo.cs">
<Link>LiveTv\RecordingInfo.cs</Link>
</Compile>
+ <Compile Include="..\MediaBrowser.Model\LiveTv\RecordingQuery.cs">
+ <Link>LiveTv\RecordingQuery.cs</Link>
+ </Compile>
<Compile Include="..\MediaBrowser.Model\Logging\ILogger.cs">
<Link>Logging\ILogger.cs</Link>
</Compile>
diff --git a/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj b/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj
index 60deab47d..471db6f25 100644
--- a/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj
+++ b/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj
@@ -211,24 +211,27 @@
<Compile Include="..\MediaBrowser.Model\IO\IZipClient.cs">
<Link>IO\IZipClient.cs</Link>
</Compile>
+ <Compile Include="..\MediaBrowser.Model\LiveTv\ChannelGuide.cs">
+ <Link>LiveTv\ChannelGuide.cs</Link>
+ </Compile>
<Compile Include="..\MediaBrowser.Model\LiveTv\ChannelInfoDto.cs">
<Link>LiveTv\ChannelInfoDto.cs</Link>
</Compile>
<Compile Include="..\MediaBrowser.Model\LiveTv\ChannelType.cs">
<Link>LiveTv\ChannelType.cs</Link>
</Compile>
- <Compile Include="..\MediaBrowser.Model\LiveTv\EpgFullInfo.cs">
- <Link>LiveTv\EpgFullInfo.cs</Link>
- </Compile>
- <Compile Include="..\MediaBrowser.Model\LiveTv\EpgInfo.cs">
- <Link>LiveTv\EpgInfo.cs</Link>
- </Compile>
<Compile Include="..\MediaBrowser.Model\LiveTv\LiveTvServiceInfo.cs">
<Link>LiveTv\LiveTvServiceInfo.cs</Link>
</Compile>
+ <Compile Include="..\MediaBrowser.Model\LiveTv\ProgramInfo.cs">
+ <Link>LiveTv\ProgramInfo.cs</Link>
+ </Compile>
<Compile Include="..\MediaBrowser.Model\LiveTv\RecordingInfo.cs">
<Link>LiveTv\RecordingInfo.cs</Link>
</Compile>
+ <Compile Include="..\MediaBrowser.Model\LiveTv\RecordingQuery.cs">
+ <Link>LiveTv\RecordingQuery.cs</Link>
+ </Compile>
<Compile Include="..\MediaBrowser.Model\Logging\ILogger.cs">
<Link>Logging\ILogger.cs</Link>
</Compile>
diff --git a/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs b/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs
index 15c905581..8daaa75ca 100644
--- a/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs
+++ b/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs
@@ -12,7 +12,17 @@ namespace MediaBrowser.Model.LiveTv
/// <value>The name.</value>
public string Name { get; set; }
+ /// <summary>
+ /// Gets or sets the identifier.
+ /// </summary>
+ /// <value>The identifier.</value>
public string Id { get; set; }
+
+ /// <summary>
+ /// Gets or sets the number.
+ /// </summary>
+ /// <value>The number.</value>
+ public string Number { get; set; }
/// <summary>
/// Gets or sets the name of the service.
diff --git a/MediaBrowser.Model/LiveTv/EpgFullInfo.cs b/MediaBrowser.Model/LiveTv/EpgFullInfo.cs
deleted file mode 100644
index 8e48537b8..000000000
--- a/MediaBrowser.Model/LiveTv/EpgFullInfo.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System.Collections.Generic;
-
-namespace MediaBrowser.Model.LiveTv
-{
- public class EpgFullInfo
- {
- /// <summary>
- /// ChannelId for the EPG.
- /// </summary>
- public string ChannelId { get; set; }
-
- /// <summary>
- /// List of all the programs for a specific channel
- /// </summary>
- public List<EpgInfo> EpgInfos { get; set; }
- }
-}
diff --git a/MediaBrowser.Model/LiveTv/EpgInfo.cs b/MediaBrowser.Model/LiveTv/EpgInfo.cs
deleted file mode 100644
index c60064882..000000000
--- a/MediaBrowser.Model/LiveTv/EpgInfo.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-using System;
-
-namespace MediaBrowser.Model.LiveTv
-{
- public class EpgInfo
- {
- /// <summary>
- /// Id of the program.
- /// </summary>
- public string Id { get; set; }
-
- /// <summary>
- /// Name of the program
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Description of the progam.
- /// </summary>
- public string Description { get; set; }
-
- /// <summary>
- /// The start date of the program, in UTC.
- /// </summary>
- public DateTime StartDate { get; set; }
-
- /// <summary>
- /// The end date of the program, in UTC.
- /// </summary>
- public DateTime EndDate { get; set; }
-
- /// <summary>
- /// Genre of the program.
- /// </summary>
- public string Genre { get; set; }
- }
-} \ No newline at end of file
diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj
index 48f298778..6ff6fcf73 100644
--- a/MediaBrowser.Model/MediaBrowser.Model.csproj
+++ b/MediaBrowser.Model/MediaBrowser.Model.csproj
@@ -60,8 +60,9 @@
<Compile Include="Dto\ItemCounts.cs" />
<Compile Include="Dto\ItemIndex.cs" />
<Compile Include="Entities\PackageReviewInfo.cs" />
- <Compile Include="LiveTv\EpgFullInfo.cs" />
- <Compile Include="LiveTv\EpgInfo.cs" />
+ <Compile Include="LiveTv\ChannelGuide.cs" />
+ <Compile Include="LiveTv\ProgramInfo.cs" />
+ <Compile Include="LiveTv\RecordingQuery.cs" />
<Compile Include="Providers\ImageProviderInfo.cs" />
<Compile Include="Providers\RemoteImageInfo.cs" />
<Compile Include="Dto\StudioDto.cs" />
diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs
index 0b36c8023..05bac17c3 100644
--- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs
+++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs
@@ -40,13 +40,9 @@ namespace MediaBrowser.Server.Implementations.LiveTv
Name = info.Name,
ServiceName = info.ServiceName,
ChannelType = info.ChannelType,
- Id = info.Id
+ Id = info.Id,
+ Number = info.Number
};
}
-
- public RecordingInfo GetRecordingInfo(RecordingInfo info)
- {
- return info;
- }
}
}