1.0.0.4 - Update due to changes in ILiveTvService

Update due to changes in ILiveTvService
This commit is contained in:
CompoUK
2015-03-20 15:47:46 +00:00
parent f062710abe
commit 595f362979
+40 -33
View File
@@ -1,8 +1,10 @@
using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Channels;
using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.LiveTv;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.MediaInfo;
using MediaBrowser.Model.Net;
@@ -42,7 +44,7 @@ namespace MediaBrowser.Plugins.VuPlus
List<ChannelInfo> tvChannelInfos = new List<ChannelInfo>();
public LiveTvService(IHttpClient httpClient, IJsonSerializer jsonSerializer,ILogger logger)
public LiveTvService(IHttpClient httpClient, IJsonSerializer jsonSerializer, ILogger logger)
{
_httpClient = httpClient;
_logger = logger;
@@ -124,7 +126,8 @@ namespace MediaBrowser.Plugins.VuPlus
{
// connect to VuPlus box to test connectivity and at same time get sRef for TV Bouquet.
tvBouquetSRef = await InitiateSession(cancellationToken, config.TVBouquet).ConfigureAwait(false);
} else
}
else
{
// connect to VuPlus box to test connectivity.
String resultNotRequired = await InitiateSession(cancellationToken, null).ConfigureAwait(false);
@@ -327,7 +330,6 @@ namespace MediaBrowser.Plugins.VuPlus
else
{
// Load channels for specified TV Bouquet only
_logger.Info("[VuPlus] GetChannelsAsync for specified TV Bouquets");
int count = 1;
XmlNodeList e2services = xml.GetElementsByTagName("e2service");
@@ -681,6 +683,7 @@ namespace MediaBrowser.Plugins.VuPlus
edate = edate.AddSeconds(edated); //add seconds
recordingInfo.EndDate = edate.ToUniversalTime();
//recordingInfo.EpisodeTitle = e2title;
recordingInfo.EpisodeTitle = null;
recordingInfo.Overview = e2description;
@@ -732,14 +735,14 @@ namespace MediaBrowser.Plugins.VuPlus
/// <returns></returns>
public async Task DeleteRecordingAsync(string recordingId, CancellationToken cancellationToken)
{
_logger.Info(string.Format("[VuPlus] Start Delete Recording Async for recordingId: {0}",recordingId));
_logger.Info(string.Format("[VuPlus] Start Delete Recording Async for recordingId: {0}", recordingId));
await EnsureConnectionAsync(cancellationToken).ConfigureAwait(false);
var protocol = "http";
if (Plugin.Instance.Configuration.UseSecureHTTPS)
protocol = "https";
var baseUrl =protocol + "://" + Plugin.Instance.Configuration.HostName + ":" + Plugin.Instance.Configuration.WebInterfacePort;
var baseUrl = protocol + "://" + Plugin.Instance.Configuration.HostName + ":" + Plugin.Instance.Configuration.WebInterfacePort;
var url = string.Format("{0}/web/moviedelete?sRef={1}", baseUrl, recordingId);
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] DeleteRecordingAsync url: {0}", url));
@@ -907,7 +910,7 @@ namespace MediaBrowser.Plugins.VuPlus
/// <returns></returns>
public async Task CreateTimerAsync(TimerInfo info, CancellationToken cancellationToken)
{
_logger.Info(string.Format("[VuPlus] Start CreateTimerAsync for ChannelId: {0} & Name: {1}",info.ChannelId, info.Name));
_logger.Info(string.Format("[VuPlus] Start CreateTimerAsync for ChannelId: {0} & Name: {1}", info.ChannelId, info.Name));
await EnsureConnectionAsync(cancellationToken).ConfigureAwait(false);
// extract eventid from info.ProgramId
@@ -1138,13 +1141,22 @@ namespace MediaBrowser.Plugins.VuPlus
}
}
public Task<List<MediaSourceInfo>> GetChannelStreamMediaSources(string channelId, CancellationToken cancellationToken)
{
throw new NotImplementedException();
}
public Task<List<MediaSourceInfo>> GetRecordingStreamMediaSources(string recordingId, CancellationToken cancellationToken)
{
throw new NotImplementedException();
}
/// <summary>
/// Get the live channel stream, zap to channel if required.
/// </summary>
/// <param name="cancellationToken">The CancellationToken</param>
/// <returns>ChannelMediaInfo</returns>
public async Task<ChannelMediaInfo> GetChannelStream(string channelOid, CancellationToken cancellationToken)
/// <returns>MediaSourceInfo</returns>
public async Task<MediaSourceInfo> GetChannelStream(string channelOid, string mediaSourceId, CancellationToken cancellationToken)
{
_logger.Info("[VuPlus] Start GetChannelStream");
@@ -1164,7 +1176,7 @@ namespace MediaBrowser.Plugins.VuPlus
string streamUrl = string.Format("{0}/{1}", baseUrl, channelOid);
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] GetChannelStream url: {0}", streamUrl));
return new ChannelMediaInfo
return new MediaSourceInfo
{
Id = _liveStreams.ToString(CultureInfo.InvariantCulture),
Path = streamUrl,
@@ -1286,7 +1298,7 @@ namespace MediaBrowser.Plugins.VuPlus
/// <returns>IEnumerable<ProgramInfo></returns>
public async Task<IEnumerable<ProgramInfo>> GetProgramsAsync(string channelId, DateTime startDateUtc, DateTime endDateUtc, CancellationToken cancellationToken)
{
_logger.Info(string.Format("[VuPlus] Start GetProgramsAsync for channelId: {0}",channelId));
_logger.Info("[VuPlus] Start GetProgramsAsync");
await EnsureConnectionAsync(cancellationToken).ConfigureAwait(false);
Random rnd = new Random();
@@ -1400,7 +1412,9 @@ namespace MediaBrowser.Plugins.VuPlus
else
{
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] GetProgramsAsync adding program for channel name : {0} program : {1}", e2eventservicename, e2eventtitle));
programInfo.HasImage = false;
//programInfo.HasImage = false;
//programInfo.ImagePath = null;
//programInfo.ImageUrl = null;
if (count == 1)
{
foreach (ChannelInfo channelInfo in tvChannelInfos)
@@ -1424,7 +1438,7 @@ namespace MediaBrowser.Plugins.VuPlus
programInfo.ChannelId = e2eventservicereference;
// the Id appears to have to be unique so will try to make it so
// for some reason the Id appears to have to be unique so will make it so
programInfo.Id = e2eventservicereference + "~" + e2eventid + "~" + count + "~" + rnd.Next();
programInfo.Overview = e2eventdescriptionextended;
@@ -1440,19 +1454,19 @@ namespace MediaBrowser.Plugins.VuPlus
genre.Add("Unknown");
programInfo.Genres = genre;
programInfo.OriginalAirDate = null;
//programInfo.OriginalAirDate = null;
programInfo.Name = e2eventtitle;
programInfo.OfficialRating = null;
programInfo.CommunityRating = null;
programInfo.EpisodeTitle = null;
programInfo.Audio = null;
programInfo.IsHD = false;
programInfo.IsRepeat = false;
programInfo.IsSeries = false;
programInfo.IsNews = false;
programInfo.IsMovie = false;
programInfo.IsKids = false;
programInfo.IsSports = false;
//programInfo.OfficialRating = null;
//programInfo.CommunityRating = null;
//programInfo.EpisodeTitle = null;
//programInfo.Audio = null;
//programInfo.IsHD = false;
//programInfo.IsRepeat = false;
//programInfo.IsSeries = false;
//programInfo.IsNews = false;
//programInfo.IsMovie = false;
//programInfo.IsKids = false;
//programInfo.IsSports = false;
programInfos.Add(programInfo);
count = count + 1;
@@ -1589,7 +1603,7 @@ namespace MediaBrowser.Plugins.VuPlus
}
public async Task<ChannelMediaInfo> GetRecordingStream(string recordingId, CancellationToken cancellationToken)
public async Task<MediaSourceInfo> GetRecordingStream(string recordingId, string mediaSourceId, CancellationToken cancellationToken)
{
throw new NotImplementedException();
}
@@ -1724,12 +1738,5 @@ namespace MediaBrowser.Plugins.VuPlus
throw new NotImplementedException();
}
public Task<ImageStream> GetLiveTvChannelsAsync(string recordingId, CancellationToken cancellationToken)
{
// Leave as is. This is handled by supplying image url to RecordingInfo
throw new NotImplementedException();
}
}
}