mirror of https://github.com/jellyfin/jellyfin.git
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>
|
/// <value><c>true</c> if this instance is repeat; otherwise, <c>false</c>.</value>
|
||||||
public bool IsRepeat { get; set; }
|
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>
|
/// <summary>
|
||||||
/// Gets or sets the episode title.
|
/// Gets or sets the episode title.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -48,12 +48,6 @@ namespace MediaBrowser.Model.LiveTv
|
||||||
/// <value>The image tags.</value>
|
/// <value>The image tags.</value>
|
||||||
public Dictionary<ImageType, string> ImageTags { get; set; }
|
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>
|
/// <summary>
|
||||||
/// Gets a value indicating whether this instance has primary image.
|
/// Gets a value indicating whether this instance has primary image.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -251,14 +251,50 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||||
{
|
{
|
||||||
info.Id = Guid.NewGuid().ToString("N");
|
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);
|
_seriesTimerProvider.Add(info);
|
||||||
|
await UpdateTimersForSeriesTimer(epgData, info).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task UpdateSeriesTimerAsync(SeriesTimerInfo info, CancellationToken cancellationToken)
|
public async Task UpdateSeriesTimerAsync(SeriesTimerInfo info, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
_seriesTimerProvider.Update(info);
|
_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)
|
public Task UpdateTimerAsync(TimerInfo info, CancellationToken cancellationToken)
|
||||||
|
@ -597,20 +633,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||||
return _config.GetConfiguration<LiveTvOptions>("livetv");
|
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 newTimers = GetTimersForSeries(seriesTimer, epgData, _recordingProvider.GetAll()).ToList();
|
||||||
|
|
||||||
var existingTimers = _timerProvider.GetAll()
|
var existingTimers = _timerProvider.GetAll()
|
||||||
|
|
|
@ -105,8 +105,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
ExternalProgramId = info.ProgramId,
|
ExternalProgramId = info.ProgramId,
|
||||||
ServiceName = service.Name,
|
ServiceName = service.Name,
|
||||||
ChannelName = channelName,
|
ChannelName = channelName,
|
||||||
ServerId = _appHost.SystemId,
|
ServerId = _appHost.SystemId
|
||||||
ExternalSeriesId = info.SeriesId
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info.ChannelId))
|
if (!string.IsNullOrEmpty(info.ChannelId))
|
||||||
|
@ -377,8 +376,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
RecordNewOnly = dto.RecordNewOnly,
|
RecordNewOnly = dto.RecordNewOnly,
|
||||||
ProgramId = dto.ExternalProgramId,
|
ProgramId = dto.ExternalProgramId,
|
||||||
ChannelId = dto.ExternalChannelId,
|
ChannelId = dto.ExternalChannelId,
|
||||||
Id = dto.ExternalId,
|
Id = dto.ExternalId
|
||||||
SeriesId = dto.ExternalSeriesId
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Convert internal server id's to external tv provider id's
|
// 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.ProductionYear = info.ProductionYear;
|
||||||
item.PremiereDate = item.PremiereDate ?? info.OriginalAirDate;
|
item.PremiereDate = item.PremiereDate ?? info.OriginalAirDate;
|
||||||
item.ExternalSeriesId = info.SeriesId;
|
|
||||||
|
|
||||||
if (isNew)
|
if (isNew)
|
||||||
{
|
{
|
||||||
|
@ -1787,8 +1786,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
ImagePath = program.ProviderImagePath,
|
ImagePath = program.ProviderImagePath,
|
||||||
ImageUrl = program.ProviderImageUrl,
|
ImageUrl = program.ProviderImageUrl,
|
||||||
Name = program.Name,
|
Name = program.Name,
|
||||||
OfficialRating = program.OfficialRating,
|
OfficialRating = program.OfficialRating
|
||||||
SeriesId = program.ExternalSeriesId
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1831,7 +1829,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
info.Overview = program.Overview;
|
info.Overview = program.Overview;
|
||||||
info.ProgramId = programDto.Id;
|
info.ProgramId = programDto.Id;
|
||||||
info.ExternalProgramId = program.ExternalId;
|
info.ExternalProgramId = program.ExternalId;
|
||||||
info.ExternalSeriesId = program.ExternalSeriesId;
|
|
||||||
|
|
||||||
if (program.EndDate.HasValue)
|
if (program.EndDate.HasValue)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue