Address comments

This commit is contained in:
Bond_009 2020-02-19 21:04:28 +01:00
parent 7060934792
commit 184ad29f3f
3 changed files with 12 additions and 10 deletions

View File

@ -28,10 +28,11 @@ namespace Emby.Server.Implementations.EntryPoints
_liveTvManager = liveTvManager;
}
/// <inheritdoc />
public Task RunAsync()
{
_liveTvManager.TimerCancelled += LiveTvManagerTimerCancelled;
_liveTvManager.SeriesTimerCancelled += LiveTvManagerSeriesTimerCancelled;
_liveTvManager.TimerCancelled += OnLiveTvManagerTimerCancelled;
_liveTvManager.SeriesTimerCancelled += OnLiveTvManagerSeriesTimerCancelled;
_liveTvManager.TimerCreated += OnLiveTvManagerTimerCreated;
_liveTvManager.SeriesTimerCreated += OnLiveTvManagerSeriesTimerCreated;
@ -48,12 +49,12 @@ namespace Emby.Server.Implementations.EntryPoints
SendMessage("TimerCreated", e.Argument);
}
private void LiveTvManagerSeriesTimerCancelled(object sender, MediaBrowser.Model.Events.GenericEventArgs<TimerEventInfo> e)
private void OnLiveTvManagerSeriesTimerCancelled(object sender, MediaBrowser.Model.Events.GenericEventArgs<TimerEventInfo> e)
{
SendMessage("SeriesTimerCancelled", e.Argument);
}
private void LiveTvManagerTimerCancelled(object sender, MediaBrowser.Model.Events.GenericEventArgs<TimerEventInfo> e)
private void OnLiveTvManagerTimerCancelled(object sender, MediaBrowser.Model.Events.GenericEventArgs<TimerEventInfo> e)
{
SendMessage("TimerCancelled", e.Argument);
}
@ -66,10 +67,6 @@ namespace Emby.Server.Implementations.EntryPoints
{
await _sessionManager.SendMessageToUserSessions(users, name, info, CancellationToken.None).ConfigureAwait(false);
}
catch (ObjectDisposedException)
{
// TODO Log exception or Investigate and properly fix.
}
catch (Exception ex)
{
_logger.LogError(ex, "Error sending message");
@ -79,8 +76,8 @@ namespace Emby.Server.Implementations.EntryPoints
/// <inheritdoc />
public void Dispose()
{
_liveTvManager.TimerCancelled -= LiveTvManagerTimerCancelled;
_liveTvManager.SeriesTimerCancelled -= LiveTvManagerSeriesTimerCancelled;
_liveTvManager.TimerCancelled -= OnLiveTvManagerTimerCancelled;
_liveTvManager.SeriesTimerCancelled -= OnLiveTvManagerSeriesTimerCancelled;
_liveTvManager.TimerCreated -= OnLiveTvManagerTimerCreated;
_liveTvManager.SeriesTimerCreated -= OnLiveTvManagerSeriesTimerCreated;
}

View File

@ -98,6 +98,7 @@ namespace Emby.Server.Implementations.LiveTv
item.Id.ToString("N", CultureInfo.InvariantCulture),
source.Id ?? string.Empty
};
source.OpenToken = string.Join(StreamIdDelimeterString, openKeys);
}
@ -113,6 +114,7 @@ namespace Emby.Server.Implementations.LiveTv
return list;
}
/// <inheritdoc />
public async Task<ILiveStream> OpenMediaSource(string openToken, List<ILiveStream> currentLiveStreams, CancellationToken cancellationToken)
{
var keys = openToken.Split(new[] { StreamIdDelimeter }, 3);

View File

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;