aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/LiveTv/EmbyTV
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations/LiveTv/EmbyTV')
-rw-r--r--Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs41
-rw-r--r--Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs16
-rw-r--r--Emby.Server.Implementations/LiveTv/EmbyTV/ItemDataProvider.cs6
-rw-r--r--Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs4
4 files changed, 23 insertions, 44 deletions
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
index ccd6cebca..75ac625ef 100644
--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Globalization;
@@ -254,27 +254,15 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
if (requiresRefresh)
{
- await _libraryManager.ValidateMediaLibrary(new SimpleProgress<Double>(), CancellationToken.None);
+ await _libraryManager.ValidateMediaLibrary(new SimpleProgress<double>(), CancellationToken.None);
}
}
- public string Name
- {
- get { return "Emby"; }
- }
+ public string Name => "Emby";
- public string DataPath
- {
- get { return Path.Combine(_config.CommonApplicationPaths.DataPath, "livetv"); }
- }
+ public string DataPath => Path.Combine(_config.CommonApplicationPaths.DataPath, "livetv");
- private string DefaultRecordingPath
- {
- get
- {
- return Path.Combine(DataPath, "recordings");
- }
- }
+ private string DefaultRecordingPath => Path.Combine(DataPath, "recordings");
private string RecordingPath
{
@@ -288,10 +276,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
}
}
- public string HomePageUrl
- {
- get { return "https://github.com/jellyfin/jellyfin"; }
- }
+ public string HomePageUrl => "https://github.com/jellyfin/jellyfin";
public async Task RefreshSeriesTimers(CancellationToken cancellationToken, IProgress<double> progress)
{
@@ -491,7 +476,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
return GetEpgChannelFromTunerChannel(info, tunerChannel, epgChannels);
}
- private string GetMappedChannel(string channelId, NameValuePair[] mappings)
+ private static string GetMappedChannel(string channelId, NameValuePair[] mappings)
{
foreach (NameValuePair mapping in mappings)
{
@@ -850,7 +835,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
return Task.CompletedTask;
}
- private void UpdateExistingTimerWithNewMetadata(TimerInfo existingTimer, TimerInfo updatedTimer)
+ private static void UpdateExistingTimerWithNewMetadata(TimerInfo existingTimer, TimerInfo updatedTimer)
{
// Update the program info but retain the status
existingTimer.ChannelId = updatedTimer.ChannelId;
@@ -980,7 +965,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
if (string.IsNullOrWhiteSpace(tunerHostId))
{
- throw new ArgumentNullException("tunerHostId");
+ throw new ArgumentNullException(nameof(tunerHostId));
}
return info.EnabledTuners.Contains(tunerHostId, StringComparer.OrdinalIgnoreCase);
@@ -1114,7 +1099,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
{
if (string.IsNullOrWhiteSpace(channelId))
{
- throw new ArgumentNullException("channelId");
+ throw new ArgumentNullException(nameof(channelId));
}
foreach (var hostInstance in _liveTvManager.TunerHosts)
@@ -1342,7 +1327,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
{
if (timer == null)
{
- throw new ArgumentNullException("timer");
+ throw new ArgumentNullException(nameof(timer));
}
LiveTvProgram programInfo = null;
@@ -1795,7 +1780,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
}
}
- private string GetPostProcessArguments(string path, string arguments)
+ private static string GetPostProcessArguments(string path, string arguments)
{
return arguments.Replace("{path}", path, StringComparison.OrdinalIgnoreCase);
}
@@ -2501,7 +2486,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
{
if (seriesTimer == null)
{
- throw new ArgumentNullException("seriesTimer");
+ throw new ArgumentNullException(nameof(seriesTimer));
}
var query = new InternalItemsQuery
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs
index a6222a469..292f3621d 100644
--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs
+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
@@ -55,14 +55,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
_assemblyInfo = assemblyInfo;
}
- private bool CopySubtitles
- {
- get
- {
- return false;
- //return string.Equals(OutputFormat, "mkv", StringComparison.OrdinalIgnoreCase);
- }
- }
+ private static bool CopySubtitles => false;
public string GetOutputPath(MediaSourceInfo mediaSource, string targetFile)
{
@@ -226,7 +219,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
return inputModifier + " " + commandLineArgs;
}
- private string GetAudioArgs(MediaSourceInfo mediaSource)
+ private static string GetAudioArgs(MediaSourceInfo mediaSource)
{
var mediaStreams = mediaSource.MediaStreams ?? new List<MediaStream>();
var inputAudioCodec = mediaStreams.Where(i => i.Type == MediaStreamType.Audio).Select(i => i.Codec).FirstOrDefault() ?? string.Empty;
@@ -242,7 +235,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
//return "-codec:a:0 aac -strict experimental -ab 320000";
}
- private bool EncodeVideo(MediaSourceInfo mediaSource)
+ private static bool EncodeVideo(MediaSourceInfo mediaSource)
{
return false;
}
@@ -383,6 +376,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
}
catch (ObjectDisposedException)
{
+ // TODO Investigate and properly fix.
// Don't spam the log. This doesn't seem to throw in windows, but sometimes under linux
}
catch (Exception ex)
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/ItemDataProvider.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/ItemDataProvider.cs
index 9f179dc2c..593f98881 100644
--- a/Emby.Server.Implementations/LiveTv/EmbyTV/ItemDataProvider.cs
+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/ItemDataProvider.cs
@@ -68,7 +68,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
{
if (newList == null)
{
- throw new ArgumentNullException("newList");
+ throw new ArgumentNullException(nameof(newList));
}
var file = _dataPath + ".json";
@@ -85,7 +85,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
{
if (item == null)
{
- throw new ArgumentNullException("item");
+ throw new ArgumentNullException(nameof(item));
}
var list = GetAll().ToList();
@@ -106,7 +106,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
{
if (item == null)
{
- throw new ArgumentNullException("item");
+ throw new ArgumentNullException(nameof(item));
}
var list = GetAll().ToList();
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs
index e4ab34770..bdc6ae009 100644
--- a/Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs
+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Concurrent;
using System.Globalization;
using System.Linq;
@@ -90,7 +90,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
AddOrUpdateSystemTimer(item);
}
- private bool ShouldStartTimer(TimerInfo item)
+ private static bool ShouldStartTimer(TimerInfo item)
{
if (item.Status == RecordingStatus.Completed ||
item.Status == RecordingStatus.Cancelled)