update recording styles
This commit is contained in:
parent
f49417c703
commit
90843b218c
|
@ -60,12 +60,6 @@ namespace MediaBrowser.Controller.LiveTv
|
|||
/// <value><c>true</c> if this instance is repeat; otherwise, <c>false</c>.</value>
|
||||
public bool IsRepeat { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the external series identifier.
|
||||
/// </summary>
|
||||
/// <value>The external series identifier.</value>
|
||||
public string ExternalSeriesId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the episode title.
|
||||
/// </summary>
|
||||
|
|
|
@ -48,12 +48,6 @@ namespace MediaBrowser.Model.LiveTv
|
|||
/// <value>The image tags.</value>
|
||||
public Dictionary<ImageType, string> ImageTags { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the external series identifier.
|
||||
/// </summary>
|
||||
/// <value>The external series identifier.</value>
|
||||
public string ExternalSeriesId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this instance has primary image.
|
||||
/// </summary>
|
||||
|
|
|
@ -251,14 +251,50 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
|||
{
|
||||
info.Id = Guid.NewGuid().ToString("N");
|
||||
|
||||
await UpdateTimersForSeriesTimer(info).ConfigureAwait(false);
|
||||
List<ProgramInfo> epgData;
|
||||
if (info.RecordAnyChannel)
|
||||
{
|
||||
var channels = await GetChannelsAsync(true, CancellationToken.None).ConfigureAwait(false);
|
||||
var channelIds = channels.Select(i => i.Id).ToList();
|
||||
epgData = GetEpgDataForChannels(channelIds);
|
||||
}
|
||||
else
|
||||
{
|
||||
epgData = GetEpgDataForChannel(info.ChannelId);
|
||||
}
|
||||
|
||||
// populate info.seriesID
|
||||
var program = epgData.FirstOrDefault(i => string.Equals(i.Id, info.ProgramId, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
if (program != null)
|
||||
{
|
||||
info.SeriesId = program.SeriesId;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidOperationException("SeriesId for program not found");
|
||||
}
|
||||
|
||||
_seriesTimerProvider.Add(info);
|
||||
await UpdateTimersForSeriesTimer(epgData, info).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public async Task UpdateSeriesTimerAsync(SeriesTimerInfo info, CancellationToken cancellationToken)
|
||||
{
|
||||
_seriesTimerProvider.Update(info);
|
||||
await UpdateTimersForSeriesTimer(info).ConfigureAwait(false);
|
||||
List<ProgramInfo> epgData;
|
||||
if (info.RecordAnyChannel)
|
||||
{
|
||||
var channels = await GetChannelsAsync(true, CancellationToken.None).ConfigureAwait(false);
|
||||
var channelIds = channels.Select(i => i.Id).ToList();
|
||||
epgData = GetEpgDataForChannels(channelIds);
|
||||
}
|
||||
else
|
||||
{
|
||||
epgData = GetEpgDataForChannel(info.ChannelId);
|
||||
}
|
||||
|
||||
await UpdateTimersForSeriesTimer(epgData, info).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public Task UpdateTimerAsync(TimerInfo info, CancellationToken cancellationToken)
|
||||
|
@ -597,20 +633,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
|||
return _config.GetConfiguration<LiveTvOptions>("livetv");
|
||||
}
|
||||
|
||||
private async Task UpdateTimersForSeriesTimer(SeriesTimerInfo seriesTimer)
|
||||
private async Task UpdateTimersForSeriesTimer(List<ProgramInfo> epgData, SeriesTimerInfo seriesTimer)
|
||||
{
|
||||
List<ProgramInfo> epgData;
|
||||
if (seriesTimer.RecordAnyChannel)
|
||||
{
|
||||
var channels = await GetChannelsAsync(true, CancellationToken.None).ConfigureAwait(false);
|
||||
var channelIds = channels.Select(i => i.Id).ToList();
|
||||
epgData = GetEpgDataForChannels(channelIds);
|
||||
}
|
||||
else
|
||||
{
|
||||
epgData = GetEpgDataForChannel(seriesTimer.ChannelId);
|
||||
}
|
||||
|
||||
var newTimers = GetTimersForSeries(seriesTimer, epgData, _recordingProvider.GetAll()).ToList();
|
||||
|
||||
var existingTimers = _timerProvider.GetAll()
|
||||
|
|
|
@ -105,8 +105,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
|||
ExternalProgramId = info.ProgramId,
|
||||
ServiceName = service.Name,
|
||||
ChannelName = channelName,
|
||||
ServerId = _appHost.SystemId,
|
||||
ExternalSeriesId = info.SeriesId
|
||||
ServerId = _appHost.SystemId
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(info.ChannelId))
|
||||
|
@ -377,8 +376,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
|||
RecordNewOnly = dto.RecordNewOnly,
|
||||
ProgramId = dto.ExternalProgramId,
|
||||
ChannelId = dto.ExternalChannelId,
|
||||
Id = dto.ExternalId,
|
||||
SeriesId = dto.ExternalSeriesId
|
||||
Id = dto.ExternalId
|
||||
};
|
||||
|
||||
// Convert internal server id's to external tv provider id's
|
||||
|
|
|
@ -627,7 +627,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
|||
|
||||
item.ProductionYear = info.ProductionYear;
|
||||
item.PremiereDate = item.PremiereDate ?? info.OriginalAirDate;
|
||||
item.ExternalSeriesId = info.SeriesId;
|
||||
|
||||
if (isNew)
|
||||
{
|
||||
|
@ -1787,8 +1786,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
|||
ImagePath = program.ProviderImagePath,
|
||||
ImageUrl = program.ProviderImageUrl,
|
||||
Name = program.Name,
|
||||
OfficialRating = program.OfficialRating,
|
||||
SeriesId = program.ExternalSeriesId
|
||||
OfficialRating = program.OfficialRating
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -1831,7 +1829,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
|||
info.Overview = program.Overview;
|
||||
info.ProgramId = programDto.Id;
|
||||
info.ExternalProgramId = program.ExternalId;
|
||||
info.ExternalSeriesId = program.ExternalSeriesId;
|
||||
|
||||
if (program.EndDate.HasValue)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user