live tv + nuget updates
This commit is contained in:
parent
01e65c93ee
commit
98d53c7838
|
@ -114,7 +114,7 @@ namespace MediaBrowser.Api.LiveTv
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
[Route("/LiveTv/Timers/{Id}", "GET")]
|
[Route("/LiveTv/SeriesTimers/{Id}", "GET")]
|
||||||
[Api(Description = "Gets a live tv series timer")]
|
[Api(Description = "Gets a live tv series timer")]
|
||||||
public class GetSeriesTimer : IReturn<TimerInfoDto>
|
public class GetSeriesTimer : IReturn<TimerInfoDto>
|
||||||
{
|
{
|
||||||
|
@ -128,6 +128,20 @@ namespace MediaBrowser.Api.LiveTv
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Route("/LiveTv/SeriesTimers/{Id}", "DELETE")]
|
||||||
|
[Api(Description = "Cancels a live tv series timer")]
|
||||||
|
public class CancelSeriesTimer : IReturnVoid
|
||||||
|
{
|
||||||
|
[ApiMember(Name = "Id", Description = "Timer Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
|
||||||
|
public string Id { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
[Route("/LiveTv/SeriesTimers/{Id}", "POST")]
|
||||||
|
[Api(Description = "Updates a live tv series timer")]
|
||||||
|
public class UpdateSeriesTimer : SeriesTimerInfoDto, IReturnVoid
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public class LiveTvService : BaseApiService
|
public class LiveTvService : BaseApiService
|
||||||
{
|
{
|
||||||
private readonly ILiveTvManager _liveTvManager;
|
private readonly ILiveTvManager _liveTvManager;
|
||||||
|
@ -265,5 +279,19 @@ namespace MediaBrowser.Api.LiveTv
|
||||||
|
|
||||||
return ToOptimizedResult(result);
|
return ToOptimizedResult(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Delete(CancelSeriesTimer request)
|
||||||
|
{
|
||||||
|
var task = _liveTvManager.CancelSeriesTimer(request.Id);
|
||||||
|
|
||||||
|
Task.WaitAll(task);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Post(UpdateSeriesTimer request)
|
||||||
|
{
|
||||||
|
var task = _liveTvManager.UpdateSeriesTimer(request, CancellationToken.None);
|
||||||
|
|
||||||
|
Task.WaitAll(task);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -45,6 +45,13 @@ namespace MediaBrowser.Controller.LiveTv
|
||||||
/// <returns>Task.</returns>
|
/// <returns>Task.</returns>
|
||||||
Task CancelTimer(string id);
|
Task CancelTimer(string id);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Cancels the series timer.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">The identifier.</param>
|
||||||
|
/// <returns>Task.</returns>
|
||||||
|
Task CancelSeriesTimer(string id);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds the parts.
|
/// Adds the parts.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -30,6 +30,14 @@ namespace MediaBrowser.Controller.LiveTv
|
||||||
/// <returns>Task.</returns>
|
/// <returns>Task.</returns>
|
||||||
Task CancelTimerAsync(string timerId, CancellationToken cancellationToken);
|
Task CancelTimerAsync(string timerId, CancellationToken cancellationToken);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Cancels the series timer asynchronous.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="timerId">The timer identifier.</param>
|
||||||
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
|
/// <returns>Task.</returns>
|
||||||
|
Task CancelSeriesTimerAsync(string timerId, CancellationToken cancellationToken);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Deletes the recording asynchronous.
|
/// Deletes the recording asynchronous.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -33,6 +33,12 @@ namespace MediaBrowser.Model.LiveTv
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ChannelName { get; set; }
|
public string ChannelName { 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>
|
/// <summary>
|
||||||
/// Name of the recording.
|
/// Name of the recording.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -21,6 +21,12 @@ namespace MediaBrowser.Model.LiveTv
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ChannelId { get; set; }
|
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>
|
/// <summary>
|
||||||
/// Gets or sets the external channel identifier.
|
/// Gets or sets the external channel identifier.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -31,6 +31,12 @@ namespace MediaBrowser.Model.LiveTv
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ChannelName { get; set; }
|
public string ChannelName { 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>
|
/// <summary>
|
||||||
/// Gets or sets the program identifier.
|
/// Gets or sets the program identifier.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -46,7 +46,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
RequiredPostPaddingSeconds = info.RequiredPostPaddingSeconds,
|
RequiredPostPaddingSeconds = info.RequiredPostPaddingSeconds,
|
||||||
RequiredPrePaddingSeconds = info.RequiredPrePaddingSeconds,
|
RequiredPrePaddingSeconds = info.RequiredPrePaddingSeconds,
|
||||||
ExternalChannelId = info.ChannelId,
|
ExternalChannelId = info.ChannelId,
|
||||||
ExternalSeriesTimerId = info.SeriesTimerId
|
ExternalSeriesTimerId = info.SeriesTimerId,
|
||||||
|
ServiceName = service.Name
|
||||||
};
|
};
|
||||||
|
|
||||||
var duration = info.EndDate - info.StartDate;
|
var duration = info.EndDate - info.StartDate;
|
||||||
|
@ -71,7 +72,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
Name = info.Name,
|
Name = info.Name,
|
||||||
StartDate = info.StartDate,
|
StartDate = info.StartDate,
|
||||||
ExternalId = info.Id,
|
ExternalId = info.Id,
|
||||||
ChannelId = GetInternalChannelId(service.Name, info.ChannelId, info.ChannelName).ToString("N"),
|
|
||||||
RequestedPostPaddingSeconds = info.RequestedPostPaddingSeconds,
|
RequestedPostPaddingSeconds = info.RequestedPostPaddingSeconds,
|
||||||
RequestedPrePaddingSeconds = info.RequestedPrePaddingSeconds,
|
RequestedPrePaddingSeconds = info.RequestedPrePaddingSeconds,
|
||||||
RequiredPostPaddingSeconds = info.RequiredPostPaddingSeconds,
|
RequiredPostPaddingSeconds = info.RequiredPostPaddingSeconds,
|
||||||
|
@ -80,9 +80,15 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
Priority = info.Priority,
|
Priority = info.Priority,
|
||||||
RecurrenceType = info.RecurrenceType,
|
RecurrenceType = info.RecurrenceType,
|
||||||
ExternalChannelId = info.ChannelId,
|
ExternalChannelId = info.ChannelId,
|
||||||
ExternalProgramId = info.ProgramId
|
ExternalProgramId = info.ProgramId,
|
||||||
|
ServiceName = service.Name
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(info.ChannelId))
|
||||||
|
{
|
||||||
|
dto.ChannelId = GetInternalChannelId(service.Name, info.ChannelId, info.ChannelName).ToString("N");
|
||||||
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info.ProgramId))
|
if (!string.IsNullOrEmpty(info.ProgramId))
|
||||||
{
|
{
|
||||||
dto.ProgramId = GetInternalProgramId(service.Name, info.ProgramId).ToString("N");
|
dto.ProgramId = GetInternalProgramId(service.Name, info.ProgramId).ToString("N");
|
||||||
|
@ -139,7 +145,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
CommunityRating = info.CommunityRating,
|
CommunityRating = info.CommunityRating,
|
||||||
OfficialRating = info.OfficialRating,
|
OfficialRating = info.OfficialRating,
|
||||||
Audio = info.Audio,
|
Audio = info.Audio,
|
||||||
IsHD = info.IsHD
|
IsHD = info.IsHD,
|
||||||
|
ServiceName = service.Name
|
||||||
};
|
};
|
||||||
|
|
||||||
if (user != null)
|
if (user != null)
|
||||||
|
|
|
@ -348,22 +348,14 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
|
|
||||||
public async Task DeleteRecording(string recordingId)
|
public async Task DeleteRecording(string recordingId)
|
||||||
{
|
{
|
||||||
var recordings = await GetRecordings(new RecordingQuery
|
var recording = await GetRecording(recordingId, CancellationToken.None).ConfigureAwait(false);
|
||||||
{
|
|
||||||
|
|
||||||
}, CancellationToken.None).ConfigureAwait(false);
|
|
||||||
|
|
||||||
var recording = recordings.Items
|
|
||||||
.FirstOrDefault(i => string.Equals(recordingId, i.Id, StringComparison.OrdinalIgnoreCase));
|
|
||||||
|
|
||||||
if (recording == null)
|
if (recording == null)
|
||||||
{
|
{
|
||||||
throw new ResourceNotFoundException(string.Format("Recording with Id {0} not found", recordingId));
|
throw new ResourceNotFoundException(string.Format("Recording with Id {0} not found", recordingId));
|
||||||
}
|
}
|
||||||
|
|
||||||
var channel = GetChannel(recording.ChannelId);
|
var service = GetServices(recording.ServiceName, null)
|
||||||
|
|
||||||
var service = GetServices(channel.ServiceName, null)
|
|
||||||
.First();
|
.First();
|
||||||
|
|
||||||
await service.DeleteRecordingAsync(recording.ExternalId, CancellationToken.None).ConfigureAwait(false);
|
await service.DeleteRecordingAsync(recording.ExternalId, CancellationToken.None).ConfigureAwait(false);
|
||||||
|
@ -371,27 +363,34 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
|
|
||||||
public async Task CancelTimer(string id)
|
public async Task CancelTimer(string id)
|
||||||
{
|
{
|
||||||
var timers = await GetTimers(new TimerQuery
|
var timer = await GetTimer(id, CancellationToken.None).ConfigureAwait(false);
|
||||||
{
|
|
||||||
|
|
||||||
}, CancellationToken.None).ConfigureAwait(false);
|
|
||||||
|
|
||||||
var timer = timers.Items
|
|
||||||
.FirstOrDefault(i => string.Equals(id, i.Id, StringComparison.OrdinalIgnoreCase));
|
|
||||||
|
|
||||||
if (timer == null)
|
if (timer == null)
|
||||||
{
|
{
|
||||||
throw new ResourceNotFoundException(string.Format("Timer with Id {0} not found", id));
|
throw new ResourceNotFoundException(string.Format("Timer with Id {0} not found", id));
|
||||||
}
|
}
|
||||||
|
|
||||||
var channel = GetChannel(timer.ChannelId);
|
var service = GetServices(timer.ServiceName, null)
|
||||||
|
|
||||||
var service = GetServices(channel.ServiceName, null)
|
|
||||||
.First();
|
.First();
|
||||||
|
|
||||||
await service.CancelTimerAsync(timer.ExternalId, CancellationToken.None).ConfigureAwait(false);
|
await service.CancelTimerAsync(timer.ExternalId, CancellationToken.None).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task CancelSeriesTimer(string id)
|
||||||
|
{
|
||||||
|
var timer = await GetSeriesTimer(id, CancellationToken.None).ConfigureAwait(false);
|
||||||
|
|
||||||
|
if (timer == null)
|
||||||
|
{
|
||||||
|
throw new ResourceNotFoundException(string.Format("Timer with Id {0} not found", id));
|
||||||
|
}
|
||||||
|
|
||||||
|
var service = GetServices(timer.ServiceName, null)
|
||||||
|
.First();
|
||||||
|
|
||||||
|
await service.CancelSeriesTimerAsync(timer.ExternalId, CancellationToken.None).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<RecordingInfoDto> GetRecording(string id, CancellationToken cancellationToken, User user = null)
|
public async Task<RecordingInfoDto> GetRecording(string id, CancellationToken cancellationToken, User user = null)
|
||||||
{
|
{
|
||||||
var results = await GetRecordings(new RecordingQuery
|
var results = await GetRecordings(new RecordingQuery
|
||||||
|
@ -416,7 +415,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
|
|
||||||
return results.Items.FirstOrDefault(i => string.Equals(i.Id, id, StringComparison.CurrentCulture));
|
return results.Items.FirstOrDefault(i => string.Equals(i.Id, id, StringComparison.CurrentCulture));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task UpdateTimer(TimerInfoDto timer, CancellationToken cancellationToken)
|
public Task UpdateTimer(TimerInfoDto timer, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var info = _tvDtoService.GetTimerInfo(timer);
|
var info = _tvDtoService.GetTimerInfo(timer);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>MediaBrowser.Common.Internal</id>
|
<id>MediaBrowser.Common.Internal</id>
|
||||||
<version>3.0.271</version>
|
<version>3.0.273</version>
|
||||||
<title>MediaBrowser.Common.Internal</title>
|
<title>MediaBrowser.Common.Internal</title>
|
||||||
<authors>Luke</authors>
|
<authors>Luke</authors>
|
||||||
<owners>ebr,Luke,scottisafool</owners>
|
<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>
|
<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>
|
<copyright>Copyright © Media Browser 2013</copyright>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency id="MediaBrowser.Common" version="3.0.271" />
|
<dependency id="MediaBrowser.Common" version="3.0.273" />
|
||||||
<dependency id="NLog" version="2.1.0" />
|
<dependency id="NLog" version="2.1.0" />
|
||||||
<dependency id="SimpleInjector" version="2.4.0" />
|
<dependency id="SimpleInjector" version="2.4.0" />
|
||||||
<dependency id="sharpcompress" version="0.10.2" />
|
<dependency id="sharpcompress" version="0.10.2" />
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>MediaBrowser.Common</id>
|
<id>MediaBrowser.Common</id>
|
||||||
<version>3.0.271</version>
|
<version>3.0.273</version>
|
||||||
<title>MediaBrowser.Common</title>
|
<title>MediaBrowser.Common</title>
|
||||||
<authors>Media Browser Team</authors>
|
<authors>Media Browser Team</authors>
|
||||||
<owners>ebr,Luke,scottisafool</owners>
|
<owners>ebr,Luke,scottisafool</owners>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>MediaBrowser.Server.Core</id>
|
<id>MediaBrowser.Server.Core</id>
|
||||||
<version>3.0.271</version>
|
<version>3.0.273</version>
|
||||||
<title>Media Browser.Server.Core</title>
|
<title>Media Browser.Server.Core</title>
|
||||||
<authors>Media Browser Team</authors>
|
<authors>Media Browser Team</authors>
|
||||||
<owners>ebr,Luke,scottisafool</owners>
|
<owners>ebr,Luke,scottisafool</owners>
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
<description>Contains core components required to build plugins for Media Browser Server.</description>
|
<description>Contains core components required to build plugins for Media Browser Server.</description>
|
||||||
<copyright>Copyright © Media Browser 2013</copyright>
|
<copyright>Copyright © Media Browser 2013</copyright>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency id="MediaBrowser.Common" version="3.0.271" />
|
<dependency id="MediaBrowser.Common" version="3.0.273" />
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user