瀏覽代碼

Reformat JustAMan review pt1 changes

Refs #575
Erwin de Haan 6 年之前
父節點
當前提交
321c440739
共有 46 個文件被更改,包括 81 次插入94 次删除
  1. 1 1
      BDInfo/BDROM.cs
  2. 1 1
      Emby.Dlna/ContentDirectory/ControlHandler.cs
  3. 2 2
      Emby.Dlna/DlnaManager.cs
  4. 2 2
      Emby.Dlna/Eventing/EventManager.cs
  5. 7 7
      Emby.Dlna/PlayTo/PlayToController.cs
  6. 3 3
      Emby.Dlna/PlayTo/PlayToManager.cs
  7. 1 1
      Emby.Drawing/ImageProcessor.cs
  8. 1 1
      Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs
  9. 0 1
      Emby.Naming/Audio/MultiPartResult.cs
  10. 0 1
      Emby.Naming/AudioBook/AudioBookFileInfo.cs
  11. 0 1
      Emby.Naming/Common/MediaType.cs
  12. 0 1
      Emby.Naming/Subtitles/SubtitleInfo.cs
  13. 0 1
      Emby.Naming/TV/EpisodeInfo.cs
  14. 0 1
      Emby.Naming/TV/EpisodePathParserResult.cs
  15. 0 1
      Emby.Naming/TV/SeasonPathParserResult.cs
  16. 0 1
      Emby.Naming/Video/CleanDateTimeResult.cs
  17. 0 1
      Emby.Naming/Video/CleanStringResult.cs
  18. 0 1
      Emby.Naming/Video/ExtraRuleType.cs
  19. 0 1
      Emby.Naming/Video/Format3DRule.cs
  20. 0 1
      Emby.Naming/Video/StubTypeRule.cs
  21. 2 2
      Emby.Server.Implementations/ApplicationHost.cs
  22. 1 1
      Emby.Server.Implementations/Channels/ChannelManager.cs
  23. 10 10
      Emby.Server.Implementations/Data/SqliteExtensions.cs
  24. 1 1
      Emby.Server.Implementations/Data/SqliteItemRepository.cs
  25. 1 1
      Emby.Server.Implementations/Dto/DtoService.cs
  26. 2 2
      Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs
  27. 1 1
      Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs
  28. 0 1
      Emby.Server.Implementations/FFMpeg/FFMpegInstallInfo.cs
  29. 1 1
      Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
  30. 3 3
      Emby.Server.Implementations/HttpServer/HttpResultFactory.cs
  31. 1 1
      Emby.Server.Implementations/HttpServer/ResponseFilter.cs
  32. 2 2
      Emby.Server.Implementations/Library/LibraryManager.cs
  33. 2 2
      Emby.Server.Implementations/Library/MediaSourceManager.cs
  34. 5 5
      Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
  35. 5 5
      Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs
  36. 3 3
      Emby.Server.Implementations/LiveTv/LiveTvManager.cs
  37. 1 1
      Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs
  38. 4 4
      Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunManager.cs
  39. 8 8
      Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs
  40. 1 1
      Emby.Server.Implementations/Localization/LocalizationManager.cs
  41. 1 1
      Emby.Server.Implementations/Services/ServiceController.cs
  42. 1 1
      Emby.Server.Implementations/Services/ServiceExec.cs
  43. 2 2
      Emby.Server.Implementations/Services/ServiceHandler.cs
  44. 3 3
      Emby.Server.Implementations/TextEncoding/NLangDetect/Detector.cs
  45. 1 1
      Emby.Server.Implementations/TextEncoding/TextEncodingDetect.cs
  46. 1 1
      Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EscCharsetProber.cs

+ 1 - 1
BDInfo/BDROM.cs

@@ -339,7 +339,7 @@ namespace BDInfo
                 throw new ArgumentNullException(nameof(path));
             }
 
-            var dir = _fileSystem.GetDirectoryInfo(path);
+            FileSystemMetadata dir = _fileSystem.GetDirectoryInfo(path);
 
             while (dir != null)
             {

+ 1 - 1
Emby.Dlna/ContentDirectory/ControlHandler.cs

@@ -192,7 +192,7 @@ namespace Emby.Dlna.ContentDirectory
 
         public string GetValueOrDefault(IDictionary<string, string> sparams, string key, string defaultValue)
         {
-            if (sparams.TryGetValue(key, out var val))
+            if (sparams.TryGetValue(key, out string val))
             {
                 return val;
             }

+ 2 - 2
Emby.Dlna/DlnaManager.cs

@@ -239,7 +239,7 @@ namespace Emby.Dlna
                 return false;
             }
 
-            if (headers.TryGetValue(header.Name, out var value))
+            if (headers.TryGetValue(header.Name, out string value))
             {
                 switch (header.Match)
                 {
@@ -286,7 +286,7 @@ namespace Emby.Dlna
         {
             lock (_profiles)
             {
-                if (_profiles.TryGetValue(path, out var profileTuple))
+                if (_profiles.TryGetValue(path, out Tuple<InternalProfileInfo, DeviceProfile> profileTuple))
                 {
                     return profileTuple.Item2;
                 }

+ 2 - 2
Emby.Dlna/Eventing/EventManager.cs

@@ -95,7 +95,7 @@ namespace Emby.Dlna.Eventing
         {
             _logger.LogDebug("Cancelling event subscription {0}", subscriptionId);
 
-            _subscriptions.TryRemove(subscriptionId, out var sub);
+            _subscriptions.TryRemove(subscriptionId, out EventSubscription sub);
 
             return new EventSubscriptionResponse
             {
@@ -126,7 +126,7 @@ namespace Emby.Dlna.Eventing
 
         private EventSubscription GetSubscription(string id, bool throwOnMissing)
         {
-            if (!_subscriptions.TryGetValue(id, out var e) && throwOnMissing)
+            if (!_subscriptions.TryGetValue(id, out EventSubscription e) && throwOnMissing)
             {
                 throw new ResourceNotFoundException("Event with Id " + id + " not found.");
             }

+ 7 - 7
Emby.Dlna/PlayTo/PlayToController.cs

@@ -98,11 +98,11 @@ namespace Emby.Dlna.PlayTo
         {
             var info = e.Argument;
 
-            info.Headers.TryGetValue("NTS", out var nts);
+            info.Headers.TryGetValue("NTS", out string nts);
 
-            if (!info.Headers.TryGetValue("USN", out var usn)) usn = string.Empty;
+            if (!info.Headers.TryGetValue("USN", out string usn)) usn = string.Empty;
 
-            if (!info.Headers.TryGetValue("NT", out var nt)) nt = string.Empty;
+            if (!info.Headers.TryGetValue("NT", out string nt)) nt = string.Empty;
 
             if (usn.IndexOf(_device.Properties.UUID, StringComparison.OrdinalIgnoreCase) != -1 &&
                 !_disposed)
@@ -636,7 +636,7 @@ namespace Emby.Dlna.PlayTo
                         return _device.ToggleMute(cancellationToken);
                     case GeneralCommandType.SetAudioStreamIndex:
                         {
-                            if (command.Arguments.TryGetValue("Index", out var arg))
+                            if (command.Arguments.TryGetValue("Index", out string arg))
                             {
                                 if (int.TryParse(arg, NumberStyles.Integer, _usCulture, out var val))
                                 {
@@ -650,7 +650,7 @@ namespace Emby.Dlna.PlayTo
                         }
                     case GeneralCommandType.SetSubtitleStreamIndex:
                         {
-                            if (command.Arguments.TryGetValue("Index", out var arg))
+                            if (command.Arguments.TryGetValue("Index", out string arg))
                             {
                                 if (int.TryParse(arg, NumberStyles.Integer, _usCulture, out var val))
                                 {
@@ -664,7 +664,7 @@ namespace Emby.Dlna.PlayTo
                         }
                     case GeneralCommandType.SetVolume:
                         {
-                            if (command.Arguments.TryGetValue("Volume", out var arg))
+                            if (command.Arguments.TryGetValue("Volume", out string arg))
                             {
                                 if (int.TryParse(arg, NumberStyles.Integer, _usCulture, out var volume))
                                 {
@@ -837,7 +837,7 @@ namespace Emby.Dlna.PlayTo
                 if (index == -1) return request;
 
                 var query = url.Substring(index + 1);
-                var values = MyHttpUtility.ParseQueryString(query);
+                QueryParamCollection values = MyHttpUtility.ParseQueryString(query);
 
                 request.DeviceProfileId = values.Get("DeviceProfileId");
                 request.DeviceId = values.Get("DeviceId");

+ 3 - 3
Emby.Dlna/PlayTo/PlayToManager.cs

@@ -78,9 +78,9 @@ namespace Emby.Dlna.PlayTo
 
             var info = e.Argument;
 
-            if (!info.Headers.TryGetValue("USN", out var usn)) usn = string.Empty;
+            if (!info.Headers.TryGetValue("USN", out string usn)) usn = string.Empty;
 
-            if (!info.Headers.TryGetValue("NT", out var nt)) nt = string.Empty;
+            if (!info.Headers.TryGetValue("NT", out string nt)) nt = string.Empty;
 
             string location = info.Location.ToString();
 
@@ -153,7 +153,7 @@ namespace Emby.Dlna.PlayTo
             _logger.LogDebug("Attempting to create PlayToController from location {0}", location);
 
             _logger.LogDebug("Logging session activity from location {0}", location);
-            if (info.Headers.TryGetValue("USN", out var uuid))
+            if (info.Headers.TryGetValue("USN", out string uuid))
             {
                 uuid = GetUuid(uuid);
             }

+ 1 - 1
Emby.Drawing/ImageProcessor.cs

@@ -846,7 +846,7 @@ namespace Emby.Drawing
         {
             lock (_locks)
             {
-                if (_locks.TryGetValue(key, out var info))
+                if (_locks.TryGetValue(key, out LockInfo info))
                 {
                     info.Count++;
                 }

+ 1 - 1
Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs

@@ -141,7 +141,7 @@ namespace IsoMounter
 
         public Task<IIsoMount> Mount(string isoPath, CancellationToken cancellationToken)
         {
-            if (MountISO(isoPath, out var mountedISO))
+            if (MountISO(isoPath, out LinuxMount mountedISO))
             {
                 return Task.FromResult<IIsoMount>(mountedISO);
             }

+ 0 - 1
Emby.Naming/Audio/MultiPartResult.cs

@@ -1,4 +1,3 @@
-
 namespace Emby.Naming.Audio
 {
     public class MultiPartResult

+ 0 - 1
Emby.Naming/AudioBook/AudioBookFileInfo.cs

@@ -1,4 +1,3 @@
-
 using System;
 
 namespace Emby.Naming.AudioBook

+ 0 - 1
Emby.Naming/Common/MediaType.cs

@@ -1,4 +1,3 @@
-
 namespace Emby.Naming.Common
 {
     public enum MediaType

+ 0 - 1
Emby.Naming/Subtitles/SubtitleInfo.cs

@@ -1,4 +1,3 @@
-
 namespace Emby.Naming.Subtitles
 {
     public class SubtitleInfo

+ 0 - 1
Emby.Naming/TV/EpisodeInfo.cs

@@ -1,4 +1,3 @@
-
 namespace Emby.Naming.TV
 {
     public class EpisodeInfo

+ 0 - 1
Emby.Naming/TV/EpisodePathParserResult.cs

@@ -1,4 +1,3 @@
-
 namespace Emby.Naming.TV
 {
     public class EpisodePathParserResult

+ 0 - 1
Emby.Naming/TV/SeasonPathParserResult.cs

@@ -1,4 +1,3 @@
-
 namespace Emby.Naming.TV
 {
     public class SeasonPathParserResult

+ 0 - 1
Emby.Naming/Video/CleanDateTimeResult.cs

@@ -1,4 +1,3 @@
-
 namespace Emby.Naming.Video
 {
     public class CleanDateTimeResult

+ 0 - 1
Emby.Naming/Video/CleanStringResult.cs

@@ -1,4 +1,3 @@
-
 namespace Emby.Naming.Video
 {
     public class CleanStringResult

+ 0 - 1
Emby.Naming/Video/ExtraRuleType.cs

@@ -1,4 +1,3 @@
-
 namespace Emby.Naming.Video
 {
     public enum ExtraRuleType

+ 0 - 1
Emby.Naming/Video/Format3DRule.cs

@@ -1,4 +1,3 @@
-
 namespace Emby.Naming.Video
 {
     public class Format3DRule

+ 0 - 1
Emby.Naming/Video/StubTypeRule.cs

@@ -1,4 +1,3 @@
-
 namespace Emby.Naming.Video
 {
     public class StubTypeRule

+ 2 - 2
Emby.Server.Implementations/ApplicationHost.cs

@@ -1790,7 +1790,7 @@ namespace Emby.Server.Implementations
                     return false;
                 }
 
-                if (minRequiredVersions.TryGetValue(filename, out var minRequiredVersion))
+                if (minRequiredVersions.TryGetValue(filename, out Version minRequiredVersion))
                 {
                     try
                     {
@@ -2005,7 +2005,7 @@ namespace Emby.Server.Implementations
                 address = address.Substring(index + 1);
             }
 
-            if (NetworkManager.TryParseIpAddress(address.Trim('/'), out var result))
+            if (NetworkManager.TryParseIpAddress(address.Trim('/'), out IpAddressInfo result))
             {
                 return result;
             }

+ 1 - 1
Emby.Server.Implementations/Channels/ChannelManager.cs

@@ -387,7 +387,7 @@ namespace Emby.Server.Implementations.Channels
 
         private async Task<IEnumerable<MediaSourceInfo>> GetChannelItemMediaSourcesInternal(IRequiresMediaInfoCallback channel, string id, CancellationToken cancellationToken)
         {
-            if (_channelItemMediaInfo.TryGetValue(id, out var cachedInfo))
+            if (_channelItemMediaInfo.TryGetValue(id, out Tuple<DateTime, List<MediaSourceInfo>> cachedInfo))
             {
                 if ((DateTime.UtcNow - cachedInfo.Item1).TotalMinutes < 5)
                 {

+ 10 - 10
Emby.Server.Implementations/Data/SqliteExtensions.cs

@@ -199,7 +199,7 @@ namespace Emby.Server.Implementations.Data
 
         public static void TryBind(this IStatement statement, string name, double value)
         {
-            if (statement.BindParameters.TryGetValue(name, out var bindParam))
+            if (statement.BindParameters.TryGetValue(name, out IBindParameter bindParam))
             {
                 bindParam.Bind(value);
             }
@@ -211,7 +211,7 @@ namespace Emby.Server.Implementations.Data
 
         public static void TryBind(this IStatement statement, string name, string value)
         {
-            if (statement.BindParameters.TryGetValue(name, out var bindParam))
+            if (statement.BindParameters.TryGetValue(name, out IBindParameter bindParam))
             {
                 if (value == null)
                 {
@@ -230,7 +230,7 @@ namespace Emby.Server.Implementations.Data
 
         public static void TryBind(this IStatement statement, string name, bool value)
         {
-            if (statement.BindParameters.TryGetValue(name, out var bindParam))
+            if (statement.BindParameters.TryGetValue(name, out IBindParameter bindParam))
             {
                 bindParam.Bind(value);
             }
@@ -242,7 +242,7 @@ namespace Emby.Server.Implementations.Data
 
         public static void TryBind(this IStatement statement, string name, float value)
         {
-            if (statement.BindParameters.TryGetValue(name, out var bindParam))
+            if (statement.BindParameters.TryGetValue(name, out IBindParameter bindParam))
             {
                 bindParam.Bind(value);
             }
@@ -254,7 +254,7 @@ namespace Emby.Server.Implementations.Data
 
         public static void TryBind(this IStatement statement, string name, int value)
         {
-            if (statement.BindParameters.TryGetValue(name, out var bindParam))
+            if (statement.BindParameters.TryGetValue(name, out IBindParameter bindParam))
             {
                 bindParam.Bind(value);
             }
@@ -266,7 +266,7 @@ namespace Emby.Server.Implementations.Data
 
         public static void TryBind(this IStatement statement, string name, Guid value)
         {
-            if (statement.BindParameters.TryGetValue(name, out var bindParam))
+            if (statement.BindParameters.TryGetValue(name, out IBindParameter bindParam))
             {
                 bindParam.Bind(value.ToGuidBlob());
             }
@@ -278,7 +278,7 @@ namespace Emby.Server.Implementations.Data
 
         public static void TryBind(this IStatement statement, string name, DateTime value)
         {
-            if (statement.BindParameters.TryGetValue(name, out var bindParam))
+            if (statement.BindParameters.TryGetValue(name, out IBindParameter bindParam))
             {
                 bindParam.Bind(value.ToDateTimeParamValue());
             }
@@ -290,7 +290,7 @@ namespace Emby.Server.Implementations.Data
 
         public static void TryBind(this IStatement statement, string name, long value)
         {
-            if (statement.BindParameters.TryGetValue(name, out var bindParam))
+            if (statement.BindParameters.TryGetValue(name, out IBindParameter bindParam))
             {
                 bindParam.Bind(value);
             }
@@ -302,7 +302,7 @@ namespace Emby.Server.Implementations.Data
 
         public static void TryBind(this IStatement statement, string name, byte[] value)
         {
-            if (statement.BindParameters.TryGetValue(name, out var bindParam))
+            if (statement.BindParameters.TryGetValue(name, out IBindParameter bindParam))
             {
                 bindParam.Bind(value);
             }
@@ -314,7 +314,7 @@ namespace Emby.Server.Implementations.Data
 
         public static void TryBindNull(this IStatement statement, string name)
         {
-            if (statement.BindParameters.TryGetValue(name, out var bindParam))
+            if (statement.BindParameters.TryGetValue(name, out IBindParameter bindParam))
             {
                 bindParam.BindNull();
             }

+ 1 - 1
Emby.Server.Implementations/Data/SqliteItemRepository.cs

@@ -5139,7 +5139,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
 
         private IEnumerable<string> MapIncludeItemTypes(string value)
         {
-            if (_types.TryGetValue(value, out var result))
+            if (_types.TryGetValue(value, out string[] result))
             {
                 return result;
             }

+ 1 - 1
Emby.Server.Implementations/Dto/DtoService.cs

@@ -637,7 +637,7 @@ namespace Emby.Server.Implementations.Dto
                     Type = person.Type
                 };
 
-                if (dictionary.TryGetValue(person.Name, out var entity))
+                if (dictionary.TryGetValue(person.Name, out Person entity))
                 {
                     baseItemPerson.PrimaryImageTag = GetImageCacheTag(entity, ImageType.Primary);
                     baseItemPerson.Id = entity.Id.ToString("N");

+ 2 - 2
Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs

@@ -108,9 +108,9 @@ namespace Emby.Server.Implementations.EntryPoints
 
             var info = e.Argument;
 
-            if (!info.Headers.TryGetValue("USN", out var usn)) usn = string.Empty;
+            if (!info.Headers.TryGetValue("USN", out string usn)) usn = string.Empty;
 
-            if (!info.Headers.TryGetValue("NT", out var nt)) nt = string.Empty;
+            if (!info.Headers.TryGetValue("NT", out string nt)) nt = string.Empty;
 
             // Filter device type
             if (usn.IndexOf("WANIPConnection:", StringComparison.OrdinalIgnoreCase) == -1 &&

+ 1 - 1
Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs

@@ -62,7 +62,7 @@ namespace Emby.Server.Implementations.EntryPoints
                     UpdateTimer.Change(UpdateDuration, Timeout.Infinite);
                 }
 
-                if (!_changedItems.TryGetValue(e.UserId, out var keys))
+                if (!_changedItems.TryGetValue(e.UserId, out List<BaseItem> keys))
                 {
                     keys = new List<BaseItem>();
                     _changedItems[e.UserId] = keys;

+ 0 - 1
Emby.Server.Implementations/FFMpeg/FFMpegInstallInfo.cs

@@ -1,4 +1,3 @@
-
 namespace Emby.Server.Implementations.FFMpeg
 {
     public class FFMpegInstallInfo

+ 1 - 1
Emby.Server.Implementations/HttpServer/HttpListenerHost.cs

@@ -700,7 +700,7 @@ namespace Emby.Server.Implementations.HttpServer
                 return null;
             }
 
-            var restPath = ServiceHandler.FindMatchingRestPath(httpReq.HttpMethod, pathInfo, out var contentType);
+            var restPath = ServiceHandler.FindMatchingRestPath(httpReq.HttpMethod, pathInfo, out string contentType);
 
             if (restPath != null)
             {

+ 3 - 3
Emby.Server.Implementations/HttpServer/HttpResultFactory.cs

@@ -96,7 +96,7 @@ namespace Emby.Server.Implementations.HttpServer
                 responseHeaders = new Dictionary<string, string>();
             }
 
-            if (addCachePrevention && !responseHeaders.TryGetValue("Expires", out var expires))
+            if (addCachePrevention && !responseHeaders.TryGetValue("Expires", out string expires))
             {
                 responseHeaders["Expires"] = "-1";
             }
@@ -142,7 +142,7 @@ namespace Emby.Server.Implementations.HttpServer
                 responseHeaders = new Dictionary<string, string>();
             }
 
-            if (addCachePrevention && !responseHeaders.TryGetValue("Expires", out var expires))
+            if (addCachePrevention && !responseHeaders.TryGetValue("Expires", out string expires))
             {
                 responseHeaders["Expires"] = "-1";
             }
@@ -186,7 +186,7 @@ namespace Emby.Server.Implementations.HttpServer
                 responseHeaders = new Dictionary<string, string>();
             }
 
-            if (addCachePrevention && !responseHeaders.TryGetValue("Expires", out var expires))
+            if (addCachePrevention && !responseHeaders.TryGetValue("Expires", out string expires))
             {
                 responseHeaders["Expires"] = "-1";
             }

+ 1 - 1
Emby.Server.Implementations/HttpServer/ResponseFilter.cs

@@ -57,7 +57,7 @@ namespace Emby.Server.Implementations.HttpServer
 
                 // Content length has to be explicitly set on on HttpListenerResponse or it won't be happy
 
-                if (hasHeaders.Headers.TryGetValue("Content-Length", out var contentLength) && !string.IsNullOrEmpty(contentLength))
+                if (hasHeaders.Headers.TryGetValue("Content-Length", out string contentLength) && !string.IsNullOrEmpty(contentLength))
                 {
                     var length = long.Parse(contentLength, UsCulture);
 

+ 2 - 2
Emby.Server.Implementations/Library/LibraryManager.cs

@@ -432,7 +432,7 @@ namespace Emby.Server.Implementations.Library
                 ItemRepository.DeleteItem(child.Id, CancellationToken.None);
             }
 
-            _libraryItemsCache.TryRemove(item.Id, out var removed);
+            _libraryItemsCache.TryRemove(item.Id, out BaseItem removed);
 
             ReportItemRemoved(item, parent);
         }
@@ -1240,7 +1240,7 @@ namespace Emby.Server.Implementations.Library
                 throw new ArgumentNullException(nameof(id));
             }
 
-            if (LibraryItemsCache.TryGetValue(id, out var item))
+            if (LibraryItemsCache.TryGetValue(id, out BaseItem item))
             {
                 return item;
             }

+ 2 - 2
Emby.Server.Implementations/Library/MediaSourceManager.cs

@@ -777,7 +777,7 @@ namespace Emby.Server.Implementations.Library
 
             try
             {
-                if (_openStreams.TryGetValue(id, out var info))
+                if (_openStreams.TryGetValue(id, out ILiveStream info))
                 {
                     return info;
                 }
@@ -809,7 +809,7 @@ namespace Emby.Server.Implementations.Library
 
             try
             {
-                if (_openStreams.TryGetValue(id, out var liveStream))
+                if (_openStreams.TryGetValue(id, out ILiveStream liveStream))
                 {
                     liveStream.ConsumerCount--;
 

+ 5 - 5
Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs

@@ -473,7 +473,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
 
         private static string GetMappedChannel(string channelId, NameValuePair[] mappings)
         {
-            foreach (var mapping in mappings)
+            foreach (NameValuePair mapping in mappings)
             {
                 if (StringHelper.EqualsIgnoreCase(mapping.Name, channelId))
                 {
@@ -1988,8 +1988,8 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
                 {
                     writer.WriteStartDocument(true);
                     writer.WriteStartElement("tvshow");
-
-                    if (timer.SeriesProviderIds.TryGetValue(MetadataProviders.Tvdb.ToString(), out var id))
+                    string id;
+                    if (timer.SeriesProviderIds.TryGetValue(MetadataProviders.Tvdb.ToString(), out id))
                     {
                         writer.WriteElementString("id", id);
                     }
@@ -2520,7 +2520,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
 
             if (string.IsNullOrWhiteSpace(channelId) && !parent.ChannelId.Equals(Guid.Empty))
             {
-                if (!tempChannelCache.TryGetValue(parent.ChannelId, out var channel))
+                if (!tempChannelCache.TryGetValue(parent.ChannelId, out LiveTvChannel channel))
                 {
                     channel = _libraryManager.GetItemList(new InternalItemsQuery
                     {
@@ -2579,7 +2579,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
 
             if (!programInfo.ChannelId.Equals(Guid.Empty))
             {
-                if (!tempChannelCache.TryGetValue(programInfo.ChannelId, out var channel))
+                if (!tempChannelCache.TryGetValue(programInfo.ChannelId, out LiveTvChannel channel))
                 {
                     channel = _libraryManager.GetItemList(new InternalItemsQuery
                     {

+ 5 - 5
Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs

@@ -137,7 +137,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings
                     var images = await GetImageForPrograms(info, programIdsWithImages, cancellationToken).ConfigureAwait(false);
 
                     var programsInfo = new List<ProgramInfo>();
-                    foreach (var schedule in dailySchedules.SelectMany(d => d.programs))
+                    foreach (ScheduleDirect.Program schedule in dailySchedules.SelectMany(d => d.programs))
                     {
                         //_logger.LogDebug("Proccesing Schedule for statio ID " + stationID +
                         //              " which corresponds to channel " + channelNumber + " and program id " +
@@ -526,15 +526,15 @@ namespace Emby.Server.Implementations.LiveTv.Listings
             try
             {
                 using (var httpResponse = await Get(options, false, info).ConfigureAwait(false))
-                using (var responce = httpResponse.Content)
+                using (Stream responce = httpResponse.Content)
                 {
                     var root = await _jsonSerializer.DeserializeFromStreamAsync<List<ScheduleDirect.Headends>>(responce).ConfigureAwait(false);
 
                     if (root != null)
                     {
-                        foreach (var headend in root)
+                        foreach (ScheduleDirect.Headends headend in root)
                         {
-                            foreach (var lineup in headend.lineups)
+                            foreach (ScheduleDirect.Lineup lineup in headend.lineups)
                             {
                                 lineups.Add(new NameIdPair
                                 {
@@ -887,7 +887,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings
 
                 var allStations = root.stations ?? Enumerable.Empty<ScheduleDirect.Station>();
 
-                foreach (var map in root.map)
+                foreach (ScheduleDirect.Map map in root.map)
                 {
                     var channelNumber = GetChannelNumber(map);
 

+ 3 - 3
Emby.Server.Implementations/LiveTv/LiveTvManager.cs

@@ -540,7 +540,7 @@ namespace Emby.Server.Implementations.LiveTv
             var isNew = false;
             var forceUpdate = false;
 
-            if (!allExistingPrograms.TryGetValue(id, out var item))
+            if (!allExistingPrograms.TryGetValue(id, out LiveTvProgram item))
             {
                 isNew = true;
                 item = new LiveTvProgram
@@ -1951,7 +1951,7 @@ namespace Emby.Server.Implementations.LiveTv
 
                 foreach (var programDto in currentProgramDtos)
                 {
-                    if (currentChannelsDict.TryGetValue(programDto.ChannelId, out var channelDto))
+                    if (currentChannelsDict.TryGetValue(programDto.ChannelId, out BaseItemDto channelDto))
                     {
                         channelDto.CurrentProgram = programDto;
                     }
@@ -2315,7 +2315,7 @@ namespace Emby.Server.Implementations.LiveTv
 
             await provider.Validate(info, validateLogin, validateListings).ConfigureAwait(false);
 
-            var config = GetConfiguration();
+            LiveTvOptions config = GetConfiguration();
 
             var list = config.ListingProviders.ToList();
             int index = list.FindIndex(i => string.Equals(i.Id, info.Id, StringComparison.OrdinalIgnoreCase));

+ 1 - 1
Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs

@@ -118,7 +118,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
             {
                 if (!string.IsNullOrEmpty(cacheKey))
                 {
-                    if (_modelCache.TryGetValue(cacheKey, out var response))
+                    if (_modelCache.TryGetValue(cacheKey, out DiscoverResponse response))
                     {
                         return response;
                     }

+ 4 - 4
Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunManager.cs

@@ -132,7 +132,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
             var receiveBuffer = new byte[8192];
             var response = await socket.ReceiveAsync(receiveBuffer, 0, receiveBuffer.Length, cancellationToken).ConfigureAwait(false);
 
-            ParseReturnMessage(response.Buffer, response.ReceivedBytes, out var returnVal);
+            ParseReturnMessage(response.Buffer, response.ReceivedBytes, out string returnVal);
 
             return string.Equals(returnVal, "none", StringComparison.OrdinalIgnoreCase);
         }
@@ -171,7 +171,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
                     continue;
 
                 var commandList = commands.GetCommands();
-                foreach (var command in commandList)
+                foreach (Tuple<string, string> command in commandList)
                 {
                     var channelMsg = CreateSetMessage(i, command.Item1, command.Item2, lockKeyValue);
                     await tcpClient.SendToAsync(channelMsg, 0, channelMsg.Length, ipEndPoint, cancellationToken).ConfigureAwait(false);
@@ -214,13 +214,13 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
                 var commandList = commands.GetCommands();
                 var receiveBuffer = new byte[8192];
 
-                foreach (var command in commandList)
+                foreach (Tuple<string, string> command in commandList)
                 {
                     var channelMsg = CreateSetMessage(_activeTuner, command.Item1, command.Item2, _lockkey);
                     await tcpClient.SendToAsync(channelMsg, 0, channelMsg.Length, new IpEndPointInfo(_remoteIp, HdHomeRunPort), cancellationToken).ConfigureAwait(false);
                     var response = await tcpClient.ReceiveAsync(receiveBuffer, 0, receiveBuffer.Length, cancellationToken).ConfigureAwait(false);
                     // parse response to make sure it worked
-                    if (!ParseReturnMessage(response.Buffer, response.ReceivedBytes, out var returnVal))
+                    if (!ParseReturnMessage(response.Buffer, response.ReceivedBytes, out string returnVal))
                     {
                         return;
                     }

+ 8 - 8
Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs

@@ -117,10 +117,10 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
 
             extInf = extInf.Trim();
 
-            var attributes = ParseExtInf(extInf, out var remaining);
+            var attributes = ParseExtInf(extInf, out string remaining);
             extInf = remaining;
 
-            if (attributes.TryGetValue("tvg-logo", out var value))
+            if (attributes.TryGetValue("tvg-logo", out string value))
             {
                 channel.ImageUrl = value;
             }
@@ -128,9 +128,9 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
             channel.Name = GetChannelName(extInf, attributes);
             channel.Number = GetChannelNumber(extInf, attributes, mediaUrl);
 
-            attributes.TryGetValue("tvg-id", out var tvgId);
+            attributes.TryGetValue("tvg-id", out string tvgId);
 
-            attributes.TryGetValue("channel-id", out var channelId);
+            attributes.TryGetValue("channel-id", out string channelId);
 
             channel.TunerChannelId = string.IsNullOrWhiteSpace(tvgId) ? channelId : tvgId;
 
@@ -182,7 +182,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
 
             if (!IsValidChannelNumber(numberString))
             {
-                if (attributes.TryGetValue("tvg-id", out var value))
+                if (attributes.TryGetValue("tvg-id", out string value))
                 {
                     if (double.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out var doubleValue))
                     {
@@ -198,7 +198,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
 
             if (!IsValidChannelNumber(numberString))
             {
-                if (attributes.TryGetValue("channel-id", out var value))
+                if (attributes.TryGetValue("channel-id", out string value))
                 {
                     numberString = value;
                 }
@@ -282,7 +282,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
                 }
             }
 
-            attributes.TryGetValue("tvg-name", out var name);
+            attributes.TryGetValue("tvg-name", out string name);
 
             if (string.IsNullOrWhiteSpace(name))
             {
@@ -291,7 +291,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
 
             if (string.IsNullOrWhiteSpace(name))
             {
-                attributes.TryGetValue("tvg-id", out name);
+                attributes.TryGetValue("tvg-id", string name);
             }
 
             if (string.IsNullOrWhiteSpace(name))

+ 1 - 1
Emby.Server.Implementations/Localization/LocalizationManager.cs

@@ -360,7 +360,7 @@ namespace Emby.Server.Implementations.Localization
 
             var ratingsDictionary = GetParentalRatingsDictionary();
 
-            if (ratingsDictionary.TryGetValue(rating, out var value))
+            if (ratingsDictionary.TryGetValue(rating, out ParentalRating value))
             {
                 return value.Value;
             }

+ 1 - 1
Emby.Server.Implementations/Services/ServiceController.cs

@@ -89,7 +89,7 @@ namespace Emby.Server.Implementations.Services
             if (restPath.Path.IndexOfAny(InvalidRouteChars) != -1)
                 throw new ArgumentException(string.Format("Route '{0}' on '{1}' contains invalid chars. ", restPath.Path, restPath.RequestType.GetMethodName()));
 
-            if (!RestPathMap.TryGetValue(restPath.FirstMatchHashKey, out var pathsAtFirstMatch))
+            if (!RestPathMap.TryGetValue(restPath.FirstMatchHashKey, out List<RestPath> pathsAtFirstMatch))
             {
                 pathsAtFirstMatch = new List<RestPath>();
                 RestPathMap[restPath.FirstMatchHashKey] = pathsAtFirstMatch;

+ 1 - 1
Emby.Server.Implementations/Services/ServiceExec.cs

@@ -73,7 +73,7 @@ namespace Emby.Server.Implementations.Services
         {
             var actionName = request.Verb ?? "POST";
 
-            if (ServiceExecGeneral.execMap.TryGetValue(ServiceMethod.Key(serviceType, actionName, requestName), out var actionContext))
+            if (execMap.TryGetValue(ServiceMethod.Key(serviceType, actionName, requestName), out ServiceMethod actionContext))
             {
                 if (actionContext.RequestFilters != null)
                 {

+ 2 - 2
Emby.Server.Implementations/Services/ServiceHandler.cs

@@ -62,7 +62,7 @@ namespace Emby.Server.Implementations.Services
         {
             if (this.RestPath == null)
             {
-                this.RestPath = FindMatchingRestPath(httpMethod, pathInfo, out var contentType);
+                this.RestPath = FindMatchingRestPath(httpMethod, pathInfo, out string contentType);
 
                 if (contentType != null)
                     ResponseContentType = contentType;
@@ -137,7 +137,7 @@ namespace Emby.Server.Implementations.Services
         public static object CreateRequest(IRequest httpReq, RestPath restPath, Dictionary<string, string> requestParams, object requestDto)
         {
             var pathInfo = !restPath.IsWildCardPath
-                ? GetSanitizedPathInfo(httpReq.PathInfo, out var contentType)
+                ? GetSanitizedPathInfo(httpReq.PathInfo, out string contentType)
                 : httpReq.PathInfo;
 
             return restPath.CreateRequest(pathInfo, requestParams, requestDto);

+ 3 - 3
Emby.Server.Implementations/TextEncoding/NLangDetect/Detector.cs

@@ -164,7 +164,7 @@ namespace NLangDetect.Core
 
         public string Detect()
         {
-            var probabilities = GetProbabilities();
+            List<Language> probabilities = GetProbabilities();
 
             return
               probabilities.Count > 0
@@ -241,7 +241,7 @@ namespace NLangDetect.Core
         {
             CleanText();
 
-            var ngrams = ExtractNGrams();
+            List<string> ngrams = ExtractNGrams();
 
             if (ngrams.Count == 0)
             {
@@ -332,7 +332,7 @@ namespace NLangDetect.Core
                 return;
             }
 
-            var langProbMap = _wordLangProbMap[word];
+            ProbVector langProbMap = _wordLangProbMap[word];
             double weight = alpha / _BaseFreq;
 
             for (int i = 0; i < prob.Length; i++)

+ 1 - 1
Emby.Server.Implementations/TextEncoding/TextEncodingDetect.cs

@@ -150,7 +150,7 @@ namespace Emby.Server.Implementations.TextEncoding
         public CharacterEncoding DetectEncoding(byte[] buffer, int size)
         {
             // First check if we have a BOM and return that if so
-            var encoding = CheckBom(buffer, size);
+            CharacterEncoding encoding = CheckBom(buffer, size);
             if (encoding != CharacterEncoding.None)
             {
                 return encoding;

+ 1 - 1
Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EscCharsetProber.cs

@@ -84,7 +84,7 @@ namespace UniversalDetector.Core
                         }
                         else if (j != activeSM)
                         {
-                            var t = codingSM[activeSM];
+                            CodingStateMachine t = codingSM[activeSM];
                             codingSM[activeSM] = codingSM[j];
                             codingSM[j] = t;
                         }