@ -398,7 +398,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
}
result = new EpgChannelData ( channels ) ;
_epgChannels . AddOrUpdate ( info . Id , result , ( k, v ) = > result ) ;
_epgChannels . AddOrUpdate ( info . Id , result , ( _, _ ) = > result ) ;
}
return result ;
@ -1248,12 +1248,11 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
var remoteMetadata = await FetchInternetMetadata ( timer , CancellationToken . None ) . ConfigureAwait ( false ) ;
var recordPath = GetRecordingPath ( timer , remoteMetadata , out string seriesPath ) ;
var recordingStatus = RecordingStatus . New ;
string liveStreamId = null ;
var channelItem = _liveTvManager . GetLiveTvChannel ( timer , this ) ;
string liveStreamId = null ;
RecordingStatus recordingStatus ;
try
{
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 ) ;
_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 )
{
@ -1937,7 +1936,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
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 )
{
@ -2126,12 +2125,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
private LiveTvProgram GetProgramInfoFromCache ( TimerInfo timer )
{
return GetProgramInfoFromCache ( timer . ProgramId , timer . ChannelId ) ;
}
private LiveTvProgram GetProgramInfoFromCache ( string programId , string channelId )
{
return GetProgramInfoFromCache ( programId ) ;
return GetProgramInfoFromCache ( timer . ProgramId ) ;
}
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
// 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 ) ;
@ -2298,17 +2292,14 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
enabledTimersForSeries . Add ( existingTimer ) ;
}
if ( updateTimerSettings )
{
existingTimer . KeepUntil = seriesTimer . KeepUntil ;
existingTimer . IsPostPaddingRequired = seriesTimer . IsPostPaddingRequired ;
existingTimer . IsPrePaddingRequired = seriesTimer . IsPrePaddingRequired ;
existingTimer . PostPaddingSeconds = seriesTimer . PostPaddingSeconds ;
existingTimer . PrePaddingSeconds = seriesTimer . PrePaddingSeconds ;
existingTimer . Priority = seriesTimer . Priority ;
}
existingTimer . KeepUntil = seriesTimer . KeepUntil ;
existingTimer . IsPostPaddingRequired = seriesTimer . IsPostPaddingRequired ;
existingTimer . IsPrePaddingRequired = seriesTimer . IsPrePaddingRequired ;
existingTimer . PostPaddingSeconds = seriesTimer . PostPaddingSeconds ;
existingTimer . PrePaddingSeconds = seriesTimer . PrePaddingSeconds ;
existingTimer . Priority = seriesTimer . Priority ;
existingTimer . SeriesTimerId = seriesTimer . Id ;
_timerProvider . Update ( existingTimer ) ;
}
}