@ -398,7 +398,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
}
}
result = new EpgChannelData ( channels ) ;
result = new EpgChannelData ( channels ) ;
_epgChannels . AddOrUpdate ( info . Id , result , ( k, v ) = > result ) ;
_epgChannels . AddOrUpdate ( info . Id , result , ( _, _ ) = > result ) ;
}
}
return result ;
return result ;
@ -1248,12 +1248,11 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
var remoteMetadata = await FetchInternetMetadata ( timer , CancellationToken . None ) . ConfigureAwait ( false ) ;
var remoteMetadata = await FetchInternetMetadata ( timer , CancellationToken . None ) . ConfigureAwait ( false ) ;
var recordPath = GetRecordingPath ( timer , remoteMetadata , out string seriesPath ) ;
var recordPath = GetRecordingPath ( timer , remoteMetadata , out string seriesPath ) ;
var recordingStatus = RecordingStatus . New ;
string liveStreamId = null ;
var channelItem = _liveTvManager . GetLiveTvChannel ( timer , this ) ;
var channelItem = _liveTvManager . GetLiveTvChannel ( timer , this ) ;
string liveStreamId = null ;
RecordingStatus recordingStatus ;
try
try
{
{
var allMediaSources = await _mediaSourceManager . GetPlaybackMediaSources ( channelItem , null , true , false , CancellationToken . None ) . ConfigureAwait ( false ) ;
var allMediaSources = await _mediaSourceManager . GetPlaybackMediaSources ( channelItem , null , true , false , CancellationToken . None ) . ConfigureAwait ( false ) ;
@ -1339,7 +1338,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
TriggerRefresh ( recordPath ) ;
TriggerRefresh ( recordPath ) ;
_libraryMonitor . ReportFileSystemChangeComplete ( recordPath , false ) ;
_libraryMonitor . ReportFileSystemChangeComplete ( recordPath , false ) ;
_activeRecordings . TryRemove ( timer . Id , out var removed ) ;
_activeRecordings . TryRemove ( timer . Id , out _ ) ;
if ( recordingStatus ! = RecordingStatus . Completed & & DateTime . UtcNow < timer . EndDate & & timer . RetryCount < 10 )
if ( recordingStatus ! = RecordingStatus . Completed & & DateTime . UtcNow < timer . EndDate & & timer . RetryCount < 10 )
{
{
@ -1937,7 +1936,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
writer . WriteElementString ( "title" , timer . EpisodeTitle ) ;
writer . WriteElementString ( "title" , timer . EpisodeTitle ) ;
}
}
var premiereDate = item . PremiereDate ? ? ( ! timer . IsRepeat ? DateTime . UtcNow : ( DateTime ? ) null ) ;
var premiereDate = item . PremiereDate ? ? ( ! timer . IsRepeat ? DateTime . UtcNow : null ) ;
if ( premiereDate . HasValue )
if ( premiereDate . HasValue )
{
{
@ -2126,12 +2125,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
private LiveTvProgram GetProgramInfoFromCache ( TimerInfo timer )
private LiveTvProgram GetProgramInfoFromCache ( TimerInfo timer )
{
{
return GetProgramInfoFromCache ( timer . ProgramId , timer . ChannelId ) ;
return GetProgramInfoFromCache ( timer . ProgramId ) ;
}
private LiveTvProgram GetProgramInfoFromCache ( string programId , string channelId )
{
return GetProgramInfoFromCache ( programId ) ;
}
}
private LiveTvProgram GetProgramInfoFromCache ( string channelId , DateTime startDateUtc )
private LiveTvProgram GetProgramInfoFromCache ( string channelId , DateTime startDateUtc )
@ -2277,7 +2271,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
{
{
// Only update if not currently active - test both new timer and existing in case Id's are different
// Only update if not currently active - test both new timer and existing in case Id's are different
// Id's could be different if the timer was created manually prior to series timer creation
// Id's could be different if the timer was created manually prior to series timer creation
if ( ! _activeRecordings . TryGetValue ( timer . Id , out var activeRecordingInfo ) & & ! _activeRecordings . TryGetValue ( existingTimer . Id , out activeRecordingInfo ) )
if ( ! _activeRecordings . TryGetValue ( timer . Id , out _ ) & & ! _activeRecordings . TryGetValue ( existingTimer . Id , out _ ) )
{
{
UpdateExistingTimerWithNewMetadata ( existingTimer , timer ) ;
UpdateExistingTimerWithNewMetadata ( existingTimer , timer ) ;
@ -2298,17 +2292,14 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
enabledTimersForSeries . Add ( existingTimer ) ;
enabledTimersForSeries . Add ( existingTimer ) ;
}
}
if ( updateTimerSettings )
existingTimer . KeepUntil = seriesTimer . KeepUntil ;
{
existingTimer . IsPostPaddingRequired = seriesTimer . IsPostPaddingRequired ;
existingTimer . KeepUntil = seriesTimer . KeepUntil ;
existingTimer . IsPrePaddingRequired = seriesTimer . IsPrePaddingRequired ;
existingTimer . IsPostPaddingRequired = seriesTimer . IsPostPaddingRequired ;
existingTimer . PostPaddingSeconds = seriesTimer . PostPaddingSeconds ;
existingTimer . IsPrePaddingRequired = seriesTimer . IsPrePaddingRequired ;
existingTimer . PrePaddingSeconds = seriesTimer . PrePaddingSeconds ;
existingTimer . PostPaddingSeconds = seriesTimer . PostPaddingSeconds ;
existingTimer . Priority = seriesTimer . Priority ;
existingTimer . PrePaddingSeconds = seriesTimer . PrePaddingSeconds ;
existingTimer . Priority = seriesTimer . Priority ;
}
existingTimer . SeriesTimerId = seriesTimer . Id ;
existingTimer . SeriesTimerId = seriesTimer . Id ;
_timerProvider . Update ( existingTimer ) ;
_timerProvider . Update ( existingTimer ) ;
}
}
}
}