aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcvium <clausvium@gmail.com>2019-01-07 20:10:26 +0100
committerBond-009 <bond.009@outlook.com>2019-01-15 16:48:21 +0100
commit0e422a33d698577a32e0a8a9058d2f7b9802b3b2 (patch)
tree4a4290fbee398e69d85798bbc008701cc4111a93
parent256e6dc1952e25b9d57a8bafba2edad88209c769 (diff)
Some code style clean up
-rw-r--r--Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs32
1 files changed, 9 insertions, 23 deletions
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
index 2c671f510..97110ab1d 100644
--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
@@ -452,18 +452,14 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
public ChannelInfo GetChannelByNumber(string number)
{
- ChannelInfo result = null;
-
- ChannelsByNumber.TryGetValue(number, out result);
+ ChannelsByNumber.TryGetValue(number, out var result);
return result;
}
public ChannelInfo GetChannelByName(string name)
{
- ChannelInfo result = null;
-
- ChannelsByName.TryGetValue(name, out result);
+ ChannelsByName.TryGetValue(name, out var result);
return result;
}
@@ -2396,10 +2392,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
}
_timerProvider.Add(timer);
- if (TimerCreated != null)
- {
- TimerCreated(this, new GenericEventArgs<TimerInfo>(timer));
- }
+ TimerCreated?.Invoke(this, new GenericEventArgs<TimerInfo>(timer));
}
else
{
@@ -2508,9 +2501,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
if (string.IsNullOrWhiteSpace(channelId) && !parent.ChannelId.Equals(Guid.Empty))
{
- LiveTvChannel channel;
-
- if (!tempChannelCache.TryGetValue(parent.ChannelId, out channel))
+ if (!tempChannelCache.TryGetValue(parent.ChannelId, out var channel))
{
channel = _libraryManager.GetItemList(new InternalItemsQuery
{
@@ -2569,9 +2560,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
if (!programInfo.ChannelId.Equals(Guid.Empty))
{
- LiveTvChannel channel;
-
- if (!tempChannelCache.TryGetValue(programInfo.ChannelId, out channel))
+ if (!tempChannelCache.TryGetValue(programInfo.ChannelId, out var channel))
{
channel = _libraryManager.GetItemList(new InternalItemsQuery
{
@@ -2769,15 +2758,12 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
{
var configuredDevice = configuredDevices.FirstOrDefault(i => string.Equals(i.DeviceId, device.DeviceId, StringComparison.OrdinalIgnoreCase));
- if (configuredDevice != null)
+ if (configuredDevice != null && !string.Equals(device.Url, configuredDevice.Url, StringComparison.OrdinalIgnoreCase))
{
- if (!string.Equals(device.Url, configuredDevice.Url, StringComparison.OrdinalIgnoreCase))
- {
- _logger.LogInformation("Tuner url has changed from {0} to {1}", configuredDevice.Url, device.Url);
+ _logger.LogInformation("Tuner url has changed from {0} to {1}", configuredDevice.Url, device.Url);
- configuredDevice.Url = device.Url;
- await _liveTvManager.SaveTunerHost(configuredDevice).ConfigureAwait(false);
- }
+ configuredDevice.Url = device.Url;
+ await _liveTvManager.SaveTunerHost(configuredDevice).ConfigureAwait(false);
}
}
}