The Free Software Media System - Server Backend & API
ReSharper conform to 'var' settings
Erwin de Haan65bd052f3e86
diff --git a/BDInfo/BDROM.cs b/BDInfo/BDROM.csindex 0b2eefcc07..2fadf3b77f 100644--- a/BDInfo/BDROM.cs+++ b/BDInfo/BDROM.cs@@ -164,7 +164,7 @@ namespace BDInfoif (DirectoryPLAYLIST != null){FileSystemMetadata[] files = GetFiles(DirectoryPLAYLIST.FullName, ".mpls").ToArray();- foreach (FileSystemMetadata file in files)+ foreach (var file in files){PlaylistFiles.Add(file.Name.ToUpper(), new TSPlaylistFile(this, file, _fileSystem, textEncoding));@@ -174,7 +174,7 @@ namespace BDInfoif (DirectorySTREAM != null){FileSystemMetadata[] files = GetFiles(DirectorySTREAM.FullName, ".m2ts").ToArray();- foreach (FileSystemMetadata file in files)+ foreach (var file in files){StreamFiles.Add(file.Name.ToUpper(), new TSStreamFile(file, _fileSystem));@@ -184,7 +184,7 @@ namespace BDInfoif (DirectoryCLIPINF != null){FileSystemMetadata[] files = GetFiles(DirectoryCLIPINF.FullName, ".clpi").ToArray();- foreach (FileSystemMetadata file in files)+ foreach (var file in files){StreamClipFiles.Add(file.Name.ToUpper(), new TSStreamClipFile(file, _fileSystem, textEncoding));@@ -194,7 +194,7 @@ namespace BDInfoif (DirectorySSIF != null){FileSystemMetadata[] files = GetFiles(DirectorySSIF.FullName, ".ssif").ToArray();- foreach (FileSystemMetadata file in files)+ foreach (var file in files){InterleavedFiles.Add(file.Name.ToUpper(), new TSInterleavedFile(file));@@ -214,8 +214,8 @@ namespace BDInfopublic void Scan(){- List<TSStreamClipFile> errorStreamClipFiles = new List<TSStreamClipFile>();- foreach (TSStreamClipFile streamClipFile in StreamClipFiles.Values)+ var errorStreamClipFiles = new List<TSStreamClipFile>();+ foreach (var streamClipFile in StreamClipFiles.Values){try{@@ -239,7 +239,7 @@ namespace BDInfo}}- foreach (TSStreamFile streamFile in StreamFiles.Values)+ foreach (var streamFile in StreamFiles.Values){string ssifName = Path.GetFileNameWithoutExtension(streamFile.Name) + ".SSIF";if (InterleavedFiles.ContainsKey(ssifName))@@ -252,8 +252,8 @@ namespace BDInfoStreamFiles.Values.CopyTo(streamFiles, 0);Array.Sort(streamFiles, CompareStreamFiles);- List<TSPlaylistFile> errorPlaylistFiles = new List<TSPlaylistFile>();- foreach (TSPlaylistFile playlistFile in PlaylistFiles.Values)+ var errorPlaylistFiles = new List<TSPlaylistFile>();+ foreach (var playlistFile in PlaylistFiles.Values){try{@@ -277,15 +277,15 @@ namespace BDInfo}}- List<TSStreamFile> errorStreamFiles = new List<TSStreamFile>();- foreach (TSStreamFile streamFile in streamFiles)+ var errorStreamFiles = new List<TSStreamFile>();+ foreach (var streamFile in streamFiles){try{- List<TSPlaylistFile> playlists = new List<TSPlaylistFile>();- foreach (TSPlaylistFile playlist in PlaylistFiles.Values)+ var playlists = new List<TSPlaylistFile>();+ foreach (var playlist in PlaylistFiles.Values){- foreach (TSStreamClip streamClip in playlist.StreamClips)+ foreach (var streamClip in playlist.StreamClips){if (streamClip.Name == streamFile.Name){@@ -314,12 +314,12 @@ namespace BDInfo}}- foreach (TSPlaylistFile playlistFile in PlaylistFiles.Values)+ foreach (var playlistFile in PlaylistFiles.Values){playlistFile.Initialize();if (!Is50Hz){- foreach (TSVideoStream videoStream in playlistFile.VideoStreams)+ foreach (var videoStream in playlistFile.VideoStreams){if (videoStream.FrameRate == TSFrameRate.FRAMERATE_25 ||videoStream.FrameRate == TSFrameRate.FRAMERATE_50)@@ -339,7 +339,7 @@ namespace BDInfothrow new ArgumentNullException(nameof(path));}- FileSystemMetadata dir = _fileSystem.GetDirectoryInfo(path);+ var dir = _fileSystem.GetDirectoryInfo(path);while (dir != null){@@ -369,7 +369,7 @@ namespace BDInfoif (dir != null){FileSystemMetadata[] children = _fileSystem.GetDirectories(dir.FullName).ToArray();- foreach (FileSystemMetadata child in children)+ foreach (var child in children){if (string.Equals(child.Name, name, StringComparison.OrdinalIgnoreCase)){@@ -378,7 +378,7 @@ namespace BDInfo}if (searchDepth > 0){- foreach (FileSystemMetadata child in children)+ foreach (var child in children){GetDirectory(name, child, searchDepth - 1);@@ -395,7 +395,7 @@ namespace BDInfo//if (!ExcludeDirs.Contains(directoryInfo.Name.ToUpper())) // TODO: Keep?{FileSystemMetadata[] pathFiles = _fileSystem.GetFiles(directoryInfo.FullName).ToArray();- foreach (FileSystemMetadata pathFile in pathFiles)+ foreach (var pathFile in pathFiles){if (pathFile.Extension.ToUpper() == ".SSIF"){@@ -405,7 +405,7 @@ namespace BDInfo}FileSystemMetadata[] pathChildren = _fileSystem.GetDirectories(directoryInfo.FullName).ToArray();- foreach (FileSystemMetadata pathChild in pathChildren)+ foreach (var pathChild in pathChildren){size += GetDirectorySize(pathChild);}diff --git a/BDInfo/TSCodecDTSHD.cs b/BDInfo/TSCodecDTSHD.csindex f2315d4c5f..57a136d2d5 100644--- a/BDInfo/TSCodecDTSHD.cs+++ b/BDInfo/TSCodecDTSHD.cs@@ -211,7 +211,7 @@ namespace BDInfo// TODOif (stream.CoreStream != null){- TSAudioStream coreStream = (TSAudioStream)stream.CoreStream;+ var coreStream = (TSAudioStream)stream.CoreStream;if (coreStream.AudioMode == TSAudioMode.Extended &&stream.ChannelCount == 5){diff --git a/BDInfo/TSPlaylistFile.cs b/BDInfo/TSPlaylistFile.csindex aa1f175d3a..ba0b37f00c 100644--- a/BDInfo/TSPlaylistFile.cs+++ b/BDInfo/TSPlaylistFile.cs@@ -85,9 +85,9 @@ namespace BDInfo_fileSystem = fileSystem;_textEncoding = textEncoding;IsCustom = true;- foreach (TSStreamClip clip in clips)+ foreach (var clip in clips){- TSStreamClip newClip = new TSStreamClip(+ var newClip = new TSStreamClip(clip.StreamFile, clip.StreamClipFile);newClip.Name = clip.Name;@@ -123,7 +123,7 @@ namespace BDInfoget{ulong size = 0;- foreach (TSStreamClip clip in StreamClips)+ foreach (var clip in StreamClips){size += clip.InterleavedFileSize;}@@ -135,7 +135,7 @@ namespace BDInfoget{ulong size = 0;- foreach (TSStreamClip clip in StreamClips)+ foreach (var clip in StreamClips){size += clip.FileSize;}@@ -147,7 +147,7 @@ namespace BDInfoget{double length = 0;- foreach (TSStreamClip clip in StreamClips)+ foreach (var clip in StreamClips){if (clip.AngleIndex == 0){@@ -163,7 +163,7 @@ namespace BDInfoget{double length = 0;- foreach (TSStreamClip clip in StreamClips)+ foreach (var clip in StreamClips){length += clip.Length;}@@ -176,7 +176,7 @@ namespace BDInfoget{ulong size = 0;- foreach (TSStreamClip clip in StreamClips)+ foreach (var clip in StreamClips){if (clip.AngleIndex == 0){@@ -192,7 +192,7 @@ namespace BDInfoget{ulong size = 0;- foreach (TSStreamClip clip in StreamClips)+ foreach (var clip in StreamClips){size += clip.PacketSize;}@@ -263,7 +263,7 @@ namespace BDInfoint itemCount = ReadInt16(data, ref pos);int subitemCount = ReadInt16(data, ref pos);- List<TSStreamClip> chapterClips = new List<TSStreamClip>();+ var chapterClips = new List<TSStreamClip>();for (int itemIndex = 0; itemIndex < itemCount; itemIndex++){int itemStart = pos;@@ -310,7 +310,7 @@ namespace BDInfoif (outTime < 0) outTime &= 0x7FFFFFFF;double timeOut = (double)outTime / 45000;- TSStreamClip streamClip = new TSStreamClip(+ var streamClip = new TSStreamClip(streamFile, streamClipFile);streamClip.Name = streamFileName; //TODO@@ -361,7 +361,7 @@ namespace BDInfoFileInfo.Name, angleClipFileName));}- TSStreamClip angleClip =+ var angleClip =new TSStreamClip(angleFile, angleClipFile);angleClip.AngleIndex = angle + 1;angleClip.TimeIn = streamClip.TimeIn;@@ -394,33 +394,33 @@ namespace BDInfofor (int i = 0; i < streamCountVideo; i++){- TSStream stream = CreatePlaylistStream(data, ref pos);+ var stream = CreatePlaylistStream(data, ref pos);if (stream != null) PlaylistStreams[stream.PID] = stream;}for (int i = 0; i < streamCountAudio; i++){- TSStream stream = CreatePlaylistStream(data, ref pos);+ var stream = CreatePlaylistStream(data, ref pos);if (stream != null) PlaylistStreams[stream.PID] = stream;}for (int i = 0; i < streamCountPG; i++){- TSStream stream = CreatePlaylistStream(data, ref pos);+ var stream = CreatePlaylistStream(data, ref pos);if (stream != null) PlaylistStreams[stream.PID] = stream;}for (int i = 0; i < streamCountIG; i++){- TSStream stream = CreatePlaylistStream(data, ref pos);+ var stream = CreatePlaylistStream(data, ref pos);if (stream != null) PlaylistStreams[stream.PID] = stream;}for (int i = 0; i < streamCountSecondaryAudio; i++){- TSStream stream = CreatePlaylistStream(data, ref pos);+ var stream = CreatePlaylistStream(data, ref pos);if (stream != null) PlaylistStreams[stream.PID] = stream;pos += 2;}for (int i = 0; i < streamCountSecondaryVideo; i++){- TSStream stream = CreatePlaylistStream(data, ref pos);+ var stream = CreatePlaylistStream(data, ref pos);if (stream != null) PlaylistStreams[stream.PID] = stream;pos += 6;}@@ -458,7 +458,7 @@ namespace BDInfo((long)data[pos + 6] << 8) +((long)data[pos + 7]);- TSStreamClip streamClip = chapterClips[streamFileIndex];+ var streamClip = chapterClips[streamFileIndex];double chapterSeconds = (double)chapterTime / 45000;@@ -498,8 +498,8 @@ namespace BDInfo{LoadStreamClips();- Dictionary<string, List<double>> clipTimes = new Dictionary<string, List<double>>();- foreach (TSStreamClip clip in StreamClips)+ var clipTimes = new Dictionary<string, List<double>>();+ foreach (var clip in StreamClips){if (clip.AngleIndex == 0){@@ -567,7 +567,7 @@ namespace BDInfoint streamLength = data[pos++];int streamPos = pos;- TSStreamType streamType = (TSStreamType)data[pos++];+ var streamType = (TSStreamType)data[pos++];switch (streamType){case TSStreamType.MVC_VIDEO:@@ -579,11 +579,11 @@ namespace BDInfocase TSStreamType.MPEG2_VIDEO:case TSStreamType.VC1_VIDEO:- TSVideoFormat videoFormat = (TSVideoFormat)+ var videoFormat = (TSVideoFormat)(data[pos] >> 4);- TSFrameRate frameRate = (TSFrameRate)+ var frameRate = (TSFrameRate)(data[pos] & 0xF);- TSAspectRatio aspectRatio = (TSAspectRatio)+ var aspectRatio = (TSAspectRatio)(data[pos + 1] >> 4);stream = new TSVideoStream();@@ -617,9 +617,9 @@ namespace BDInfoint audioFormat = ReadByte(data, ref pos);- TSChannelLayout channelLayout = (TSChannelLayout)+ var channelLayout = (TSChannelLayout)(audioFormat >> 4);- TSSampleRate sampleRate = (TSSampleRate)+ var sampleRate = (TSSampleRate)(audioFormat & 0xF);string audioLanguage = ReadString(data, 3, ref pos);@@ -712,7 +712,7 @@ namespace BDInfo{referenceClip = StreamClips[0];}- foreach (TSStreamClip clip in StreamClips)+ foreach (var clip in StreamClips){if (clip.StreamClipFile.Streams.Count > referenceClip.StreamClipFile.Streams.Count){@@ -738,12 +738,12 @@ namespace BDInfo}}- foreach (TSStream clipStream+ foreach (var clipStreamin referenceClip.StreamClipFile.Streams.Values){if (!Streams.ContainsKey(clipStream.PID)){- TSStream stream = clipStream.Clone();+ var stream = clipStream.Clone();Streams[clipStream.PID] = stream;if (!IsCustom && !PlaylistStreams.ContainsKey(stream.PID))@@ -779,7 +779,7 @@ namespace BDInforeferenceClip.StreamFile.Streams.ContainsKey(4114) &&!Streams.ContainsKey(4114)){- TSStream stream = referenceClip.StreamFile.Streams[4114].Clone();+ var stream = referenceClip.StreamFile.Streams[4114].Clone();Streams[4114] = stream;if (stream.IsVideoStream){@@ -787,12 +787,12 @@ namespace BDInfo}}- foreach (TSStream clipStream+ foreach (var clipStreamin referenceClip.StreamFile.Streams.Values){if (Streams.ContainsKey(clipStream.PID)){- TSStream stream = Streams[clipStream.PID];+ var stream = Streams[clipStream.PID];if (stream.StreamType != clipStream.StreamType) continue;@@ -811,8 +811,8 @@ namespace BDInfoelse if (stream.IsAudioStream &&clipStream.IsAudioStream){- TSAudioStream audioStream = (TSAudioStream)stream;- TSAudioStream clipAudioStream = (TSAudioStream)clipStream;+ var audioStream = (TSAudioStream)stream;+ var clipAudioStream = (TSAudioStream)clipStream;if (clipAudioStream.ChannelCount > audioStream.ChannelCount){@@ -863,7 +863,7 @@ namespace BDInfoSortedStreams.Add(stream);for (int i = 0; i < AngleCount; i++){- TSStream angleStream = stream.Clone();+ var angleStream = stream.Clone();angleStream.AngleIndex = i + 1;AngleStreams[i][angleStream.PID] = angleStream;SortedStreams.Add(angleStream);@@ -900,7 +900,7 @@ namespace BDInfopublic void ClearBitrates(){- foreach (TSStreamClip clip in StreamClips)+ foreach (var clip in StreamClips){clip.PayloadBytes = 0;clip.PacketCount = 0;@@ -908,7 +908,7 @@ namespace BDInfoif (clip.StreamFile != null){- foreach (TSStream stream in clip.StreamFile.Streams.Values)+ foreach (var stream in clip.StreamFile.Streams.Values){stream.PayloadBytes = 0;stream.PacketCount = 0;@@ -923,7 +923,7 @@ namespace BDInfo}}- foreach (TSStream stream in SortedStreams)+ foreach (var stream in SortedStreams){stream.PayloadBytes = 0;stream.PacketCount = 0;diff --git a/BDInfo/TSStream.cs b/BDInfo/TSStream.csindex fad3f1acbc..3c30a85971 100644--- a/BDInfo/TSStream.cs+++ b/BDInfo/TSStream.cs@@ -109,7 +109,7 @@ namespace BDInfopublic TSDescriptor Clone(){- TSDescriptor descriptor =+ var descriptor =new TSDescriptor(Name, (byte)Value.Length);Value.CopyTo(descriptor.Value, 0);return descriptor;@@ -404,7 +404,7 @@ namespace BDInfoif (Descriptors != null){stream.Descriptors = new List<TSDescriptor>();- foreach (TSDescriptor descriptor in Descriptors)+ foreach (var descriptor in Descriptors){stream.Descriptors.Add(descriptor.Clone());}@@ -553,7 +553,7 @@ namespace BDInfopublic override TSStream Clone(){- TSVideoStream stream = new TSVideoStream();+ var stream = new TSVideoStream();CopyTo(stream);stream.VideoFormat = _VideoFormat;@@ -727,7 +727,7 @@ namespace BDInfopublic override TSStream Clone(){- TSAudioStream stream = new TSAudioStream();+ var stream = new TSAudioStream();CopyTo(stream);stream.SampleRate = SampleRate;@@ -756,7 +756,7 @@ namespace BDInfopublic override TSStream Clone(){- TSGraphicsStream stream = new TSGraphicsStream();+ var stream = new TSGraphicsStream();CopyTo(stream);return stream;}@@ -772,7 +772,7 @@ namespace BDInfopublic override TSStream Clone(){- TSTextStream stream = new TSTextStream();+ var stream = new TSTextStream();CopyTo(stream);return stream;}diff --git a/BDInfo/TSStreamBuffer.cs b/BDInfo/TSStreamBuffer.csindex 17025c2e31..30bd1a3f44 100644--- a/BDInfo/TSStreamBuffer.cs+++ b/BDInfo/TSStreamBuffer.cs@@ -111,7 +111,7 @@ namespace BDInfodata += (Stream.ReadByte() << shift);shift -= 8;}- BitVector32 vector = new BitVector32(data);+ var vector = new BitVector32(data);int value = 0;for (int i = SkipBits; i < SkipBits + bits; i++)diff --git a/BDInfo/TSStreamClip.cs b/BDInfo/TSStreamClip.csindex 20f795e536..295eeb6b18 100644--- a/BDInfo/TSStreamClip.cs+++ b/BDInfo/TSStreamClip.cs@@ -90,11 +90,11 @@ namespace BDInfopublic bool IsCompatible(TSStreamClip clip){- foreach (TSStream stream1 in StreamFile.Streams.Values)+ foreach (var stream1 in StreamFile.Streams.Values){if (clip.StreamFile.Streams.ContainsKey(stream1.PID)){- TSStream stream2 = clip.StreamFile.Streams[stream1.PID];+ var stream2 = clip.StreamFile.Streams[stream1.PID];if (stream1.StreamType != stream2.StreamType){return false;diff --git a/BDInfo/TSStreamClipFile.cs b/BDInfo/TSStreamClipFile.csindex 6aed7e4d43..be6299e1a8 100644--- a/BDInfo/TSStreamClipFile.cs+++ b/BDInfo/TSStreamClipFile.cs@@ -114,7 +114,7 @@ namespace BDInfostreamOffset += 2;- TSStreamType streamType = (TSStreamType)+ var streamType = (TSStreamType)clipData[streamOffset + 1];switch (streamType){@@ -127,11 +127,11 @@ namespace BDInfocase TSStreamType.MPEG2_VIDEO:case TSStreamType.VC1_VIDEO:{- TSVideoFormat videoFormat = (TSVideoFormat)+ var videoFormat = (TSVideoFormat)(clipData[streamOffset + 2] >> 4);- TSFrameRate frameRate = (TSFrameRate)+ var frameRate = (TSFrameRate)(clipData[streamOffset + 2] & 0xF);- TSAspectRatio aspectRatio = (TSAspectRatio)+ var aspectRatio = (TSAspectRatio)(clipData[streamOffset + 3] >> 4);stream = new TSVideoStream();@@ -168,9 +168,9 @@ namespace BDInfostring languageCode =_textEncoding.GetASCIIEncoding().GetString(languageBytes, 0, languageBytes.Length);- TSChannelLayout channelLayout = (TSChannelLayout)+ var channelLayout = (TSChannelLayout)(clipData[streamOffset + 2] >> 4);- TSSampleRate sampleRate = (TSSampleRate)+ var sampleRate = (TSSampleRate)(clipData[streamOffset + 2] & 0xF);stream = new TSAudioStream();diff --git a/BDInfo/TSStreamFile.cs b/BDInfo/TSStreamFile.csindex 29d105da0e..ecf6609e2e 100644--- a/BDInfo/TSStreamFile.cs+++ b/BDInfo/TSStreamFile.cs@@ -283,7 +283,7 @@ namespace BDInfobool isAVC = false;bool isMVC = false;- foreach (TSStream finishedStream in Streams.Values)+ foreach (var finishedStream in Streams.Values){if (!finishedStream.IsInitialized){@@ -327,10 +327,10 @@ namespace BDInfoUpdateStreamBitrate(PID, PTSPID, PTS, PTSDiff);}- foreach (TSPlaylistFile playlist in Playlists)+ foreach (var playlist in Playlists){double packetSeconds = 0;- foreach (TSStreamClip clip in playlist.StreamClips)+ foreach (var clip in playlist.StreamClips){if (clip.AngleIndex == 0){@@ -339,7 +339,7 @@ namespace BDInfo}if (packetSeconds > 0){- foreach (TSStream playlistStream in playlist.SortedStreams)+ foreach (var playlistStream in playlist.SortedStreams){if (playlistStream.IsVBR){@@ -366,14 +366,14 @@ namespace BDInfo{if (Playlists == null) return;- TSStreamState streamState = StreamStates[PID];+ var streamState = StreamStates[PID];double streamTime = (double)PTS / 90000;double streamInterval = (double)PTSDiff / 90000;double streamOffset = streamTime + streamInterval;- foreach (TSPlaylistFile playlist in Playlists)+ foreach (var playlist in Playlists){- foreach (TSStreamClip clip in playlist.StreamClips)+ foreach (var clip in playlist.StreamClips){if (clip.Name != this.Name) continue;@@ -390,7 +390,7 @@ namespace BDInfoclip.PacketSeconds = streamOffset - clip.TimeIn;}- Dictionary<ushort, TSStream> playlistStreams = playlist.Streams;+ var playlistStreams = playlist.Streams;if (clip.AngleIndex > 0 &&clip.AngleIndex < playlist.AngleStreams.Count + 1){@@ -398,7 +398,7 @@ namespace BDInfo}if (playlistStreams.ContainsKey(PID)){- TSStream stream = playlistStreams[PID];+ var stream = playlistStreams[PID];stream.PayloadBytes += streamState.WindowBytes;stream.PacketCount += streamState.WindowPackets;@@ -425,13 +425,13 @@ namespace BDInfoif (Streams.ContainsKey(PID)){- TSStream stream = Streams[PID];+ var stream = Streams[PID];stream.PayloadBytes += streamState.WindowBytes;stream.PacketCount += streamState.WindowPackets;if (stream.IsVideoStream){- TSStreamDiagnostics diag = new TSStreamDiagnostics();+ var diag = new TSStreamDiagnostics();diag.Marker = (double)PTS / 90000;diag.Interval = (double)PTSDiff / 90000;diag.Bytes = streamState.WindowBytes;@@ -482,7 +482,7 @@ namespace BDInfoStreamStates.Clear();StreamDiagnostics.Clear();- TSPacketParser parser =+ var parser =new TSPacketParser();long fileLength = (uint)fileStream.Length;@@ -839,7 +839,7 @@ namespace BDInfoif (!Streams.ContainsKey(streamPID)){- List<TSDescriptor> streamDescriptors =+ var streamDescriptors =new List<TSDescriptor>();/*@@ -996,7 +996,7 @@ namespace BDInfo{--parser.PMTProgramDescriptorLength;- TSDescriptor descriptor = parser.PMTProgramDescriptors[+ var descriptor = parser.PMTProgramDescriptors[parser.PMTProgramDescriptors.Count - 1];int valueIndex =@@ -1026,8 +1026,8 @@ namespace BDInfoparser.StreamState != null &&parser.TransportScramblingControl == 0){- TSStream stream = parser.Stream;- TSStreamState streamState = parser.StreamState;+ var stream = parser.Stream;+ var streamState = parser.StreamState;streamState.Parse =(streamState.Parse << 8) + buffer[i];@@ -1461,7 +1461,7 @@ namespace BDInfoulong PTSLast = 0;ulong PTSDiff = 0;- foreach (TSStream stream in Streams.Values)+ foreach (var stream in Streams.Values){if (!stream.IsVideoStream) continue;diff --git a/DvdLib/Ifo/Dvd.cs b/DvdLib/Ifo/Dvd.csindex a8f2ab9708..71ba2d5e4f 100644--- a/DvdLib/Ifo/Dvd.cs+++ b/DvdLib/Ifo/Dvd.cs@@ -45,7 +45,7 @@ namespace DvdLib.Ifo{using (var vmgFs = _fileSystem.GetFileStream(vmgPath.FullName, FileOpenMode.Open, FileAccessMode.Read, FileShareMode.Read)){- using (BigEndianBinaryReader vmgRead = new BigEndianBinaryReader(vmgFs))+ using (var vmgRead = new BigEndianBinaryReader(vmgFs)){vmgFs.Seek(0x3E, SeekOrigin.Begin);_titleSetCount = vmgRead.ReadUInt16();@@ -71,7 +71,7 @@ namespace DvdLib.Iforead.BaseStream.Seek(6, SeekOrigin.Current);for (uint titleNum = 1; titleNum <= _titleCount; titleNum++){- Title t = new Title(titleNum);+ var t = new Title(titleNum);t.ParseTT_SRPT(read);Titles.Add(t);}@@ -98,7 +98,7 @@ namespace DvdLib.Ifousing (var vtsFs = _fileSystem.GetFileStream(vtsPath, FileOpenMode.Open, FileAccessMode.Read, FileShareMode.Read)){- using (BigEndianBinaryReader vtsRead = new BigEndianBinaryReader(vtsFs))+ using (var vtsRead = new BigEndianBinaryReader(vtsFs)){// Read VTS_PTT_SRPTvtsFs.Seek(0xC8, SeekOrigin.Begin);@@ -119,7 +119,7 @@ namespace DvdLib.Ifo{uint chapNum = 1;vtsFs.Seek(baseAddr + offsets[titleNum], SeekOrigin.Begin);- Title t = Titles.FirstOrDefault(vtst => vtst.IsVTSTitle(vtsNum, titleNum + 1));+ var t = Titles.FirstOrDefault(vtst => vtst.IsVTSTitle(vtsNum, titleNum + 1));if (t == null) continue;do@@ -149,7 +149,7 @@ namespace DvdLib.IfovtsFs.Seek(3, SeekOrigin.Current);uint vtsPgcOffset = vtsRead.ReadUInt32();- Title t = Titles.FirstOrDefault(vtst => vtst.IsVTSTitle(vtsNum, titleNum));+ var t = Titles.FirstOrDefault(vtst => vtst.IsVTSTitle(vtsNum, titleNum));if (t != null) t.AddPgc(vtsRead, startByte + vtsPgcOffset, entryPgc, pgcNum);}}diff --git a/DvdLib/Ifo/ProgramChain.cs b/DvdLib/Ifo/ProgramChain.csindex 0cdaad4ccb..80889738f1 100644--- a/DvdLib/Ifo/ProgramChain.cs+++ b/DvdLib/Ifo/ProgramChain.cs@@ -87,7 +87,7 @@ namespace DvdLib.Ifobr.BaseStream.Seek(startPos + _cellPositionOffset, SeekOrigin.Begin);for (int cellNum = 0; cellNum < _cellCount; cellNum++){- Cell c = new Cell();+ var c = new Cell();c.ParsePosition(br);Cells.Add(c);}@@ -99,7 +99,7 @@ namespace DvdLib.Ifo}br.BaseStream.Seek(startPos + _programMapOffset, SeekOrigin.Begin);- List<int> cellNumbers = new List<int>();+ var cellNumbers = new List<int>();for (int progNum = 0; progNum < _programCount; progNum++) cellNumbers.Add(br.ReadByte() - 1);for (int i = 0; i < cellNumbers.Count; i++)diff --git a/DvdLib/Ifo/Title.cs b/DvdLib/Ifo/Title.csindex 85be9daf10..335e929928 100644--- a/DvdLib/Ifo/Title.cs+++ b/DvdLib/Ifo/Title.cs@@ -50,7 +50,7 @@ namespace DvdLib.Ifolong curPos = br.BaseStream.Position;br.BaseStream.Seek(startByte, SeekOrigin.Begin);- ProgramChain pgc = new ProgramChain(pgcNum);+ var pgc = new ProgramChain(pgcNum);pgc.ParseHeader(br);ProgramChains.Add(pgc);if (entryPgc) EntryProgramChain = pgc;diff --git a/Emby.Dlna/Api/DlnaServerService.cs b/Emby.Dlna/Api/DlnaServerService.csindex f4009ee936..01c9fe50f5 100644--- a/Emby.Dlna/Api/DlnaServerService.cs+++ b/Emby.Dlna/Api/DlnaServerService.cs@@ -241,7 +241,7 @@ namespace Emby.Dlna.Apivar cacheLength = TimeSpan.FromDays(365);var cacheKey = Request.RawUrl.GetMD5();- return _resultFactory.GetStaticResult(Request, cacheKey, null, cacheLength, contentType, () => Task.FromResult<Stream>(_dlnaManager.GetIcon(request.Filename).Stream));+ return _resultFactory.GetStaticResult(Request, cacheKey, null, cacheLength, contentType, () => Task.FromResult(_dlnaManager.GetIcon(request.Filename).Stream));}public object Subscribe(ProcessContentDirectoryEventRequest request)diff --git a/Emby.Dlna/ContentDirectory/ControlHandler.cs b/Emby.Dlna/ContentDirectory/ControlHandler.csindex 61ee45f740..5a8fd40685 100644--- a/Emby.Dlna/ContentDirectory/ControlHandler.cs+++ b/Emby.Dlna/ContentDirectory/ControlHandler.cs@@ -242,7 +242,7 @@ namespace Emby.Dlna.ContentDirectoryvar dlnaOptions = _config.GetDlnaConfiguration();- using (XmlWriter writer = XmlWriter.Create(builder, settings))+ using (var writer = XmlWriter.Create(builder, settings)){//writer.WriteStartDocument();@@ -358,7 +358,7 @@ namespace Emby.Dlna.ContentDirectoryint totalCount = 0;int provided = 0;- using (XmlWriter writer = XmlWriter.Create(builder, settings))+ using (var writer = XmlWriter.Create(builder, settings)){//writer.WriteStartDocument();diff --git a/Emby.Dlna/Didl/DidlBuilder.cs b/Emby.Dlna/Didl/DidlBuilder.csindex 6ecb9f3b47..d2f635e567 100644--- a/Emby.Dlna/Didl/DidlBuilder.cs+++ b/Emby.Dlna/Didl/DidlBuilder.cs@@ -78,7 +78,7 @@ namespace Emby.Dlna.Didlusing (StringWriter builder = new StringWriterWithEncoding(Encoding.UTF8)){- using (XmlWriter writer = XmlWriter.Create(builder, settings))+ using (var writer = XmlWriter.Create(builder, settings)){//writer.WriteStartDocument();diff --git a/Emby.Dlna/PlayTo/PlayToController.cs b/Emby.Dlna/PlayTo/PlayToController.csindex 95be02ff43..85a37d7f8f 100644--- a/Emby.Dlna/PlayTo/PlayToController.cs+++ b/Emby.Dlna/PlayTo/PlayToController.cs@@ -854,7 +854,7 @@ namespace Emby.Dlna.PlayToif (index == -1) return request;var query = url.Substring(index + 1);- QueryParamCollection values = MyHttpUtility.ParseQueryString(query);+ var values = MyHttpUtility.ParseQueryString(query);request.DeviceProfileId = values.Get("DeviceProfileId");request.DeviceId = values.Get("DeviceId");diff --git a/Emby.Dlna/Service/BaseControlHandler.cs b/Emby.Dlna/Service/BaseControlHandler.csindex d65f8972bc..5f78674b88 100644--- a/Emby.Dlna/Service/BaseControlHandler.cs+++ b/Emby.Dlna/Service/BaseControlHandler.cs@@ -85,7 +85,7 @@ namespace Emby.Dlna.ServiceStringWriter builder = new StringWriterWithEncoding(Encoding.UTF8);- using (XmlWriter writer = XmlWriter.Create(builder, settings))+ using (var writer = XmlWriter.Create(builder, settings)){writer.WriteStartDocument(true);diff --git a/Emby.Dlna/Service/ControlErrorHandler.cs b/Emby.Dlna/Service/ControlErrorHandler.csindex e9c2c67b9e..d5eb4a8879 100644--- a/Emby.Dlna/Service/ControlErrorHandler.cs+++ b/Emby.Dlna/Service/ControlErrorHandler.cs@@ -20,7 +20,7 @@ namespace Emby.Dlna.ServiceStringWriter builder = new StringWriterWithEncoding(Encoding.UTF8);- using (XmlWriter writer = XmlWriter.Create(builder, settings))+ using (var writer = XmlWriter.Create(builder, settings)){writer.WriteStartDocument(true);diff --git a/Emby.Drawing.Skia/StripCollageBuilder.cs b/Emby.Drawing.Skia/StripCollageBuilder.csindex 36d00669ab..8d984de116 100644--- a/Emby.Drawing.Skia/StripCollageBuilder.cs+++ b/Emby.Drawing.Skia/StripCollageBuilder.cs@@ -164,7 +164,7 @@ namespace Emby.Drawing.Skiaprivate SKBitmap GetNextValidImage(string[] paths, int currentIndex, out int newIndex){- Dictionary<int, int> imagesTested = new Dictionary<int, int>();+ var imagesTested = new Dictionary<int, int>();SKBitmap bitmap = null;while (imagesTested.Count < paths.Length)@@ -174,7 +174,7 @@ namespace Emby.Drawing.SkiacurrentIndex = 0;}- bitmap = SkiaEncoder.Decode(paths[currentIndex], false, _fileSystem, null, out SKEncodedOrigin origin);+ bitmap = SkiaEncoder.Decode(paths[currentIndex], false, _fileSystem, null, out var origin);imagesTested[currentIndex] = 0;diff --git a/Emby.Drawing/Common/ImageHeader.cs b/Emby.Drawing/Common/ImageHeader.csindex 6b604bc15e..3939a16641 100644--- a/Emby.Drawing/Common/ImageHeader.cs+++ b/Emby.Drawing/Common/ImageHeader.cs@@ -73,7 +73,7 @@ namespace Emby.Drawing.Common/// </summary>/// <param name="binaryReader">The binary reader.</param>/// <returns>Size.</returns>- /// <exception cref="System.ArgumentException">binaryReader</exception>+ /// <exception cref="ArgumentException">binaryReader</exception>/// <exception cref="ArgumentException">The image was of an unrecognized format.</exception>private static ImageSize GetDimensions(BinaryReader binaryReader){@@ -200,7 +200,7 @@ namespace Emby.Drawing.Common/// </summary>/// <param name="binaryReader">The binary reader.</param>/// <returns>Size.</returns>- /// <exception cref="System.ArgumentException"></exception>+ /// <exception cref="ArgumentException"></exception>private static ImageSize DecodeJfif(BinaryReader binaryReader){// A JPEG image consists of a sequence of segments,diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.csindex 57a6eb148c..a88c720a70 100644--- a/Emby.Drawing/ImageProcessor.cs+++ b/Emby.Drawing/ImageProcessor.cs@@ -491,7 +491,7 @@ namespace Emby.Drawing/// <param name="item">The item.</param>/// <param name="image">The image.</param>/// <returns>Guid.</returns>- /// <exception cref="System.ArgumentNullException">item</exception>+ /// <exception cref="ArgumentNullException">item</exception>public string GetImageCacheTag(BaseItem item, ItemImageInfo image){var supportedEnhancers = GetSupportedEnhancers(item, image.Type);@@ -523,7 +523,7 @@ namespace Emby.Drawing/// <param name="image">The image.</param>/// <param name="imageEnhancers">The image enhancers.</param>/// <returns>Guid.</returns>- /// <exception cref="System.ArgumentNullException">item</exception>+ /// <exception cref="ArgumentNullException">item</exception>public string GetImageCacheTag(BaseItem item, ItemImageInfo image, IImageEnhancer[] imageEnhancers){var originalImagePath = image.Path;@@ -744,7 +744,7 @@ namespace Emby.Drawing/// <param name="uniqueName">Name of the unique.</param>/// <param name="fileExtension">The file extension.</param>/// <returns>System.String.</returns>- /// <exception cref="System.ArgumentNullException">+ /// <exception cref="ArgumentNullException">/// path/// or/// uniqueName@@ -778,7 +778,7 @@ namespace Emby.Drawing/// <param name="path">The path.</param>/// <param name="filename">The filename.</param>/// <returns>System.String.</returns>- /// <exception cref="System.ArgumentNullException">+ /// <exception cref="ArgumentNullException">/// path/// or/// filenamediff --git a/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs b/Emby.IsoMounting/IsoMounter/LinuxIsoManager.csindex ac486f1675..4729b5b5a6 100644--- a/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs+++ b/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs@@ -141,7 +141,7 @@ namespace IsoMounterpublic Task<IIsoMount> Mount(string isoPath, CancellationToken cancellationToken){- if (MountISO(isoPath, out LinuxMount mountedISO))+ if (MountISO(isoPath, out var mountedISO)){return Task.FromResult<IIsoMount>(mountedISO);}diff --git a/Emby.Naming/AudioBook/AudioBookFilePathParser.cs b/Emby.Naming/AudioBook/AudioBookFilePathParser.csindex 8c52fd9b9f..b386593e72 100644--- a/Emby.Naming/AudioBook/AudioBookFilePathParser.cs+++ b/Emby.Naming/AudioBook/AudioBookFilePathParser.cs@@ -16,7 +16,7 @@ namespace Emby.Naming.AudioBookpublic AudioBookFilePathParserResult Parse(string path, bool IsDirectory){- AudioBookFilePathParserResult result = Parse(path);+ var result = Parse(path);return !result.Success ? new AudioBookFilePathParserResult() : result;}diff --git a/Emby.Naming/TV/EpisodePathParser.cs b/Emby.Naming/TV/EpisodePathParser.csindex 76c59d38ec..260cb505c3 100644--- a/Emby.Naming/TV/EpisodePathParser.cs+++ b/Emby.Naming/TV/EpisodePathParser.cs@@ -133,7 +133,7 @@ namespace Emby.Naming.TVresult.EpisodeNumber = num;}- Group endingNumberGroup = match.Groups["endingepnumber"];+ var endingNumberGroup = match.Groups["endingepnumber"];if (endingNumberGroup.Success){// Will only set EndingEpsiodeNumber if the captured number is not followed by additional numbersdiff --git a/Emby.Naming/Video/VideoResolver.cs b/Emby.Naming/Video/VideoResolver.csindex de8f96965f..9bd0cb3dfb 100644--- a/Emby.Naming/Video/VideoResolver.cs+++ b/Emby.Naming/Video/VideoResolver.cs@@ -40,7 +40,7 @@ namespace Emby.Naming.Video/// <param name="path">The path.</param>/// <param name="IsDirectory">if set to <c>true</c> [is folder].</param>/// <returns>VideoFileInfo.</returns>- /// <exception cref="System.ArgumentNullException">path</exception>+ /// <exception cref="ArgumentNullException">path</exception>public VideoFileInfo Resolve(string path, bool IsDirectory, bool parseName = true){if (string.IsNullOrEmpty(path))diff --git a/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs b/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.csindex 90a0671f28..a8e8f815a0 100644--- a/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs+++ b/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs@@ -527,7 +527,7 @@ namespace Emby.Server.Implementations.Activityconst int DaysInMonth = 30;// Get each non-zero value from TimeSpan component- List<string> values = new List<string>();+ var values = new List<string>();// Number of yearsint days = span.Days;@@ -558,7 +558,7 @@ namespace Emby.Server.Implementations.Activityvalues.Add(CreateValueString(span.Seconds, "second"));// Combine values into string- StringBuilder builder = new StringBuilder();+ var builder = new StringBuilder();for (int i = 0; i < values.Count; i++){if (builder.Length > 0)diff --git a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.csindex 6f393a03c3..59c7c655f1 100644--- a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs+++ b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs@@ -151,7 +151,7 @@ namespace Emby.Server.Implementations.AppBase/// Replaces the configuration./// </summary>/// <param name="newConfiguration">The new configuration.</param>- /// <exception cref="System.ArgumentNullException">newConfiguration</exception>+ /// <exception cref="ArgumentNullException">newConfiguration</exception>public virtual void ReplaceConfiguration(BaseApplicationConfiguration newConfiguration){if (newConfiguration == null)@@ -188,7 +188,7 @@ namespace Emby.Server.Implementations.AppBase/// Replaces the cache path./// </summary>/// <param name="newConfig">The new configuration.</param>- /// <exception cref="System.IO.DirectoryNotFoundException"></exception>+ /// <exception cref="DirectoryNotFoundException"></exception>private void ValidateCachePath(BaseApplicationConfiguration newConfig){var newPath = newConfig.CachePath;diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.csindex 61b88345f2..5f3508441c 100644--- a/Emby.Server.Implementations/ApplicationHost.cs+++ b/Emby.Server.Implementations/ApplicationHost.cs@@ -822,7 +822,7 @@ namespace Emby.Server.ImplementationsRegisterSingleInstance(ServerConfigurationManager);IAssemblyInfo assemblyInfo = new AssemblyInfo();- RegisterSingleInstance<IAssemblyInfo>(assemblyInfo);+ RegisterSingleInstance(assemblyInfo);LocalizationManager = new LocalizationManager(ServerConfigurationManager, FileSystemManager, JsonSerializer, LoggerFactory.CreateLogger("LocalizationManager"), assemblyInfo, new TextLocalizer());StringExtensions.LocalizationManager = LocalizationManager;@@ -920,7 +920,7 @@ namespace Emby.Server.ImplementationsRegisterSingleInstance(CollectionManager);PlaylistManager = new PlaylistManager(LibraryManager, FileSystemManager, LibraryMonitor, LoggerFactory.CreateLogger("PlaylistManager"), UserManager, ProviderManager);- RegisterSingleInstance<IPlaylistManager>(PlaylistManager);+ RegisterSingleInstance(PlaylistManager);LiveTvManager = new LiveTvManager(this, HttpClient, ServerConfigurationManager, Logger, ItemRepository, ImageProcessor, UserDataManager, DtoService, UserManager, LibraryManager, TaskManager, LocalizationManager, JsonSerializer, ProviderManager, FileSystemManager, SecurityManager, () => ChannelManager);RegisterSingleInstance(LiveTvManager);@@ -938,7 +938,7 @@ namespace Emby.Server.ImplementationsRegisterMediaEncoder(assemblyInfo);- EncodingManager = new Emby.Server.Implementations.MediaEncoder.EncodingManager(FileSystemManager, Logger, MediaEncoder, ChapterManager, LibraryManager);+ EncodingManager = new MediaEncoder.EncodingManager(FileSystemManager, Logger, MediaEncoder, ChapterManager, LibraryManager);RegisterSingleInstance(EncodingManager);var activityLogRepo = GetActivityLogRepository();@@ -950,7 +950,7 @@ namespace Emby.Server.ImplementationsRegisterSingleInstance<ISessionContext>(new SessionContext(UserManager, authContext, SessionManager));AuthService = new AuthService(UserManager, authContext, ServerConfigurationManager, SessionManager, NetworkManager);- RegisterSingleInstance<IAuthService>(AuthService);+ RegisterSingleInstance(AuthService);SubtitleEncoder = new MediaBrowser.MediaEncoding.Subtitles.SubtitleEncoder(LibraryManager, LoggerFactory.CreateLogger("SubtitleEncoder"), ApplicationPaths, FileSystemManager, MediaEncoder, JsonSerializer, HttpClient, MediaSourceManager, ProcessFactory, TextEncoding);RegisterSingleInstance(SubtitleEncoder);@@ -1023,7 +1023,7 @@ namespace Emby.Server.Implementations{var arr = str.ToCharArray();- arr = Array.FindAll<char>(arr, (c => (char.IsLetterOrDigit(c)+ arr = Array.FindAll(arr, (c => (char.IsLetterOrDigit(c)|| char.IsWhiteSpace(c))));var result = new string(arr);@@ -1057,7 +1057,7 @@ namespace Emby.Server.Implementations// Don't use an empty string passwordvar password = string.IsNullOrWhiteSpace(info.Password) ? null : info.Password;- X509Certificate2 localCert = new X509Certificate2(certificateLocation, password);+ var localCert = new X509Certificate2(certificateLocation, password);//localCert.PrivateKey = PrivateKey.CreateFromFile(pvk_file).RSA;if (!localCert.HasPrivateKey){diff --git a/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs b/Emby.Server.Implementations/Configuration/ServerConfigurationManager.csindex 55f40db8f9..ab2e1c9a96 100644--- a/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs+++ b/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs@@ -119,7 +119,7 @@ namespace Emby.Server.Implementations.Configuration/// Replaces the configuration./// </summary>/// <param name="newConfiguration">The new configuration.</param>- /// <exception cref="System.IO.DirectoryNotFoundException"></exception>+ /// <exception cref="DirectoryNotFoundException"></exception>public override void ReplaceConfiguration(BaseApplicationConfiguration newConfiguration){var newConfig = (ServerConfiguration)newConfiguration;@@ -137,7 +137,7 @@ namespace Emby.Server.Implementations.Configuration/// Validates the SSL certificate./// </summary>/// <param name="newConfig">The new configuration.</param>- /// <exception cref="System.IO.DirectoryNotFoundException"></exception>+ /// <exception cref="DirectoryNotFoundException"></exception>private void ValidateSslCertificate(BaseApplicationConfiguration newConfig){var serverConfig = (ServerConfiguration)newConfig;@@ -159,7 +159,7 @@ namespace Emby.Server.Implementations.Configuration/// Validates the metadata path./// </summary>/// <param name="newConfig">The new configuration.</param>- /// <exception cref="System.IO.DirectoryNotFoundException"></exception>+ /// <exception cref="DirectoryNotFoundException"></exception>private void ValidateMetadataPath(ServerConfiguration newConfig){var newPath = newConfig.MetadataPath;diff --git a/Emby.Server.Implementations/Data/ManagedConnection.cs b/Emby.Server.Implementations/Data/ManagedConnection.csindex 2f3dfc4d1c..b8f1e581ab 100644--- a/Emby.Server.Implementations/Data/ManagedConnection.cs+++ b/Emby.Server.Implementations/Data/ManagedConnection.cs@@ -47,7 +47,7 @@ namespace Emby.Server.Implementations.Datapublic T RunInTransaction<T>(Func<IDatabaseConnection, T> action, TransactionMode mode){- return db.RunInTransaction<T>(action, mode);+ return db.RunInTransaction(action, mode);}public IEnumerable<IReadOnlyList<IResultSetValue>> Query(string sql)diff --git a/Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs b/Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.csindex 822573f20b..9ed2b49e58 100644--- a/Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs+++ b/Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs@@ -83,7 +83,7 @@ namespace Emby.Server.Implementations.Data/// <param name="client">The client.</param>/// <param name="cancellationToken">The cancellation token.</param>/// <returns>Task.</returns>- /// <exception cref="System.ArgumentNullException">item</exception>+ /// <exception cref="ArgumentNullException">item</exception>public void SaveDisplayPreferences(DisplayPreferences displayPreferences, Guid userId, string client, CancellationToken cancellationToken){if (displayPreferences == null)@@ -131,7 +131,7 @@ namespace Emby.Server.Implementations.Data/// <param name="userId">The user id.</param>/// <param name="cancellationToken">The cancellation token.</param>/// <returns>Task.</returns>- /// <exception cref="System.ArgumentNullException">item</exception>+ /// <exception cref="ArgumentNullException">item</exception>public void SaveAllDisplayPreferences(IEnumerable<DisplayPreferences> displayPreferences, Guid userId, CancellationToken cancellationToken){if (displayPreferences == null)@@ -163,7 +163,7 @@ namespace Emby.Server.Implementations.Data/// <param name="userId">The user id.</param>/// <param name="client">The client.</param>/// <returns>Task{DisplayPreferences}.</returns>- /// <exception cref="System.ArgumentNullException">item</exception>+ /// <exception cref="ArgumentNullException">item</exception>public DisplayPreferences GetDisplayPreferences(string displayPreferencesId, Guid userId, string client){if (string.IsNullOrEmpty(displayPreferencesId))@@ -202,7 +202,7 @@ namespace Emby.Server.Implementations.Data/// </summary>/// <param name="userId">The user id.</param>/// <returns>Task{DisplayPreferences}.</returns>- /// <exception cref="System.ArgumentNullException">item</exception>+ /// <exception cref="ArgumentNullException">item</exception>public IEnumerable<DisplayPreferences> GetAllDisplayPreferences(Guid userId){var list = new List<DisplayPreferences>();diff --git a/Emby.Server.Implementations/Data/SqliteExtensions.cs b/Emby.Server.Implementations/Data/SqliteExtensions.csindex 5ff61d37c3..edb73d2a15 100644--- a/Emby.Server.Implementations/Data/SqliteExtensions.cs+++ b/Emby.Server.Implementations/Data/SqliteExtensions.cs@@ -128,7 +128,7 @@ namespace Emby.Server.Implementations.Data/// Serializes to bytes./// </summary>/// <returns>System.Byte[][].</returns>- /// <exception cref="System.ArgumentNullException">obj</exception>+ /// <exception cref="ArgumentNullException">obj</exception>public static byte[] SerializeToBytes(this IJsonSerializer json, object obj){if (obj == null)diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.csindex 325bad501e..7e72713714 100644--- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs+++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs@@ -531,7 +531,7 @@ namespace Emby.Server.Implementations.Data/// </summary>/// <param name="item">The item.</param>/// <param name="cancellationToken">The cancellation token.</param>- /// <exception cref="System.ArgumentNullException">item</exception>+ /// <exception cref="ArgumentNullException">item</exception>public void SaveItem(BaseItem item, CancellationToken cancellationToken){if (item == null)@@ -574,7 +574,7 @@ namespace Emby.Server.Implementations.Data/// </summary>/// <param name="items">The items.</param>/// <param name="cancellationToken">The cancellation token.</param>- /// <exception cref="System.ArgumentNullException">+ /// <exception cref="ArgumentNullException">/// items/// or/// cancellationToken@@ -1198,8 +1198,8 @@ namespace Emby.Server.Implementations.Data/// </summary>/// <param name="id">The id.</param>/// <returns>BaseItem.</returns>- /// <exception cref="System.ArgumentNullException">id</exception>- /// <exception cref="System.ArgumentException"></exception>+ /// <exception cref="ArgumentNullException">id</exception>+ /// <exception cref="ArgumentException"></exception>public BaseItem RetrieveItem(Guid id){if (id.Equals(Guid.Empty))@@ -1945,7 +1945,7 @@ namespace Emby.Server.Implementations.Data/// </summary>/// <param name="item">The item.</param>/// <returns>IEnumerable{ChapterInfo}.</returns>- /// <exception cref="System.ArgumentNullException">id</exception>+ /// <exception cref="ArgumentNullException">id</exception>public List<ChapterInfo> GetChapters(BaseItem item){CheckDisposed();@@ -1977,7 +1977,7 @@ namespace Emby.Server.Implementations.Data/// <param name="item">The item.</param>/// <param name="index">The index.</param>/// <returns>ChapterInfo.</returns>- /// <exception cref="System.ArgumentNullException">id</exception>+ /// <exception cref="ArgumentNullException">id</exception>public ChapterInfo GetChapter(BaseItem item, int index){CheckDisposed();diff --git a/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs b/Emby.Server.Implementations/Data/SqliteUserDataRepository.csindex 469927f637..48ff9ded80 100644--- a/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs+++ b/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs@@ -110,7 +110,7 @@ namespace Emby.Server.Implementations.Dataprivate List<Guid> GetAllUserIdsWithUserData(IDatabaseConnection db){- List<Guid> list = new List<Guid>();+ var list = new List<Guid>();using (var statement = PrepareStatement(db, "select DISTINCT UserId from UserData where UserId not null")){@@ -271,7 +271,7 @@ namespace Emby.Server.Implementations.Data/// <param name="internalUserId">The user id.</param>/// <param name="key">The key.</param>/// <returns>Task{UserItemData}.</returns>- /// <exception cref="System.ArgumentNullException">+ /// <exception cref="ArgumentNullException">/// userId/// or/// keydiff --git a/Emby.Server.Implementations/Data/SqliteUserRepository.cs b/Emby.Server.Implementations/Data/SqliteUserRepository.csindex bf00f2e657..ad37a02753 100644--- a/Emby.Server.Implementations/Data/SqliteUserRepository.cs+++ b/Emby.Server.Implementations/Data/SqliteUserRepository.cs@@ -200,7 +200,7 @@ namespace Emby.Server.Implementations.Data/// </summary>/// <param name="user">The user.</param>/// <returns>Task.</returns>- /// <exception cref="System.ArgumentNullException">user</exception>+ /// <exception cref="ArgumentNullException">user</exception>public void DeleteUser(User user){if (user == null)diff --git a/Emby.Server.Implementations/Data/TypeMapper.cs b/Emby.Server.Implementations/Data/TypeMapper.csindex fa6a29aa3d..37c952e88e 100644--- a/Emby.Server.Implementations/Data/TypeMapper.cs+++ b/Emby.Server.Implementations/Data/TypeMapper.cs@@ -27,7 +27,7 @@ namespace Emby.Server.Implementations.Data/// </summary>/// <param name="typeName">Name of the type.</param>/// <returns>Type.</returns>- /// <exception cref="System.ArgumentNullException"></exception>+ /// <exception cref="ArgumentNullException"></exception>public Type GetType(string typeName){if (string.IsNullOrEmpty(typeName))diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.csindex 68bff962fd..8877fc051f 100644--- a/Emby.Server.Implementations/Dto/DtoService.cs+++ b/Emby.Server.Implementations/Dto/DtoService.cs@@ -71,7 +71,7 @@ namespace Emby.Server.Implementations.Dto/// <param name="user">The user.</param>/// <param name="owner">The owner.</param>/// <returns>Task{DtoBaseItem}.</returns>- /// <exception cref="System.ArgumentNullException">item</exception>+ /// <exception cref="ArgumentNullException">item</exception>public BaseItemDto GetBaseItemDto(BaseItem item, ItemFields[] fields, User user = null, BaseItem owner = null){var options = new DtoOptions@@ -463,7 +463,7 @@ namespace Emby.Server.Implementations.Dto/// </summary>/// <param name="item">The item.</param>/// <returns>System.String.</returns>- /// <exception cref="System.ArgumentNullException">item</exception>+ /// <exception cref="ArgumentNullException">item</exception>public string GetDtoId(BaseItem item){return item.Id.ToString("N");diff --git a/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs b/Emby.Server.Implementations/EntryPoints/RecordingNotifier.csindex c7bd03960d..e37ea96a12 100644--- a/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs+++ b/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs@@ -58,7 +58,7 @@ namespace Emby.Server.Implementations.EntryPointstry{- await _sessionManager.SendMessageToUserSessions<TimerEventInfo>(users, name, info, CancellationToken.None);+ await _sessionManager.SendMessageToUserSessions(users, name, info, CancellationToken.None);}catch (ObjectDisposedException){diff --git a/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs b/Emby.Server.Implementations/HttpClientManager/HttpClientManager.csindex 72828f0d4b..255e1476f5 100644--- a/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs+++ b/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs@@ -82,7 +82,7 @@ namespace Emby.Server.Implementations.HttpClientManager/// <param name="host">The host.</param>/// <param name="enableHttpCompression">if set to <c>true</c> [enable HTTP compression].</param>/// <returns>HttpClient.</returns>- /// <exception cref="System.ArgumentNullException">host</exception>+ /// <exception cref="ArgumentNullException">host</exception>private HttpClientInfo GetHttpClient(string host, bool enableHttpCompression){if (string.IsNullOrEmpty(host))@@ -125,7 +125,7 @@ namespace Emby.Server.Implementations.HttpClientManager{string url = options.Url;- Uri uriAddress = new Uri(url);+ var uriAddress = new Uri(url);string userInfo = uriAddress.UserInfo;if (!string.IsNullOrWhiteSpace(userInfo)){@@ -133,7 +133,7 @@ namespace Emby.Server.Implementations.HttpClientManagerurl = url.Replace(userInfo + "@", string.Empty);}- WebRequest request = CreateWebRequest(url);+ var request = CreateWebRequest(url);if (request is HttpWebRequest httpWebRequest){@@ -188,7 +188,7 @@ namespace Emby.Server.Implementations.HttpClientManagerprivate static CredentialCache GetCredential(string url, string username, string password){//ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;- CredentialCache credentialCache = new CredentialCache();+ var credentialCache = new CredentialCache();credentialCache.Add(new Uri(url), "Basic", new NetworkCredential(username, password));return credentialCache;}@@ -807,7 +807,7 @@ namespace Emby.Server.Implementations.HttpClientManager{var taskCompletion = new TaskCompletionSource<WebResponse>();- Task<WebResponse> asyncTask = Task.Factory.FromAsync<WebResponse>(request.BeginGetResponse, request.EndGetResponse, null);+ var asyncTask = Task.Factory.FromAsync(request.BeginGetResponse, request.EndGetResponse, null);ThreadPool.RegisterWaitForSingleObject((asyncTask as IAsyncResult).AsyncWaitHandle, TimeoutCallback, request, timeout, true);var callback = new TaskCallback { taskCompletion = taskCompletion };@@ -823,7 +823,7 @@ namespace Emby.Server.Implementations.HttpClientManager{if (timedOut && state != null){- WebRequest request = (WebRequest)state;+ var request = (WebRequest)state;request.Abort();}}diff --git a/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs b/Emby.Server.Implementations/HttpServer/WebSocketConnection.csindex 1ad92a83fb..b9146d0076 100644--- a/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs+++ b/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs@@ -77,7 +77,7 @@ namespace Emby.Server.Implementations.HttpServer/// <param name="remoteEndPoint">The remote end point.</param>/// <param name="jsonSerializer">The json serializer.</param>/// <param name="logger">The logger.</param>- /// <exception cref="System.ArgumentNullException">socket</exception>+ /// <exception cref="ArgumentNullException">socket</exception>public WebSocketConnection(IWebSocket socket, string remoteEndPoint, IJsonSerializer jsonSerializer, ILogger logger, ITextEncoding textEncoding){if (socket == null)@@ -215,7 +215,7 @@ namespace Emby.Server.Implementations.HttpServer/// <param name="message">The message.</param>/// <param name="cancellationToken">The cancellation token.</param>/// <returns>Task.</returns>- /// <exception cref="System.ArgumentNullException">message</exception>+ /// <exception cref="ArgumentNullException">message</exception>public Task SendAsync<T>(WebSocketMessage<T> message, CancellationToken cancellationToken){if (message == null)diff --git a/Emby.Server.Implementations/IO/IsoManager.cs b/Emby.Server.Implementations/IO/IsoManager.csindex e82335d65e..f0a15097c9 100644--- a/Emby.Server.Implementations/IO/IsoManager.cs+++ b/Emby.Server.Implementations/IO/IsoManager.cs@@ -23,8 +23,8 @@ namespace Emby.Server.Implementations.IO/// <param name="isoPath">The iso path.</param>/// <param name="cancellationToken">The cancellation token.</param>/// <returns>IsoMount.</returns>- /// <exception cref="System.ArgumentNullException">isoPath</exception>- /// <exception cref="System.ArgumentException"></exception>+ /// <exception cref="ArgumentNullException">isoPath</exception>+ /// <exception cref="ArgumentException"></exception>public Task<IIsoMount> Mount(string isoPath, CancellationToken cancellationToken){if (string.IsNullOrEmpty(isoPath))diff --git a/Emby.Server.Implementations/IO/LibraryMonitor.cs b/Emby.Server.Implementations/IO/LibraryMonitor.csindex 39ed1afa79..2c92e65432 100644--- a/Emby.Server.Implementations/IO/LibraryMonitor.cs+++ b/Emby.Server.Implementations/IO/LibraryMonitor.cs@@ -263,7 +263,7 @@ namespace Emby.Server.Implementations.IO/// <param name="lst">The LST.</param>/// <param name="path">The path.</param>/// <returns><c>true</c> if [contains parent folder] [the specified LST]; otherwise, <c>false</c>.</returns>- /// <exception cref="System.ArgumentNullException">path</exception>+ /// <exception cref="ArgumentNullException">path</exception>private static bool ContainsParentFolder(IEnumerable<string> lst, string path){if (string.IsNullOrEmpty(path))diff --git a/Emby.Server.Implementations/IO/ManagedFileSystem.cs b/Emby.Server.Implementations/IO/ManagedFileSystem.csindex 7574eb0e98..ae14701908 100644--- a/Emby.Server.Implementations/IO/ManagedFileSystem.cs+++ b/Emby.Server.Implementations/IO/ManagedFileSystem.cs@@ -101,7 +101,7 @@ namespace Emby.Server.Implementations.IO/// </summary>/// <param name="filename">The filename.</param>/// <returns><c>true</c> if the specified filename is shortcut; otherwise, <c>false</c>.</returns>- /// <exception cref="System.ArgumentNullException">filename</exception>+ /// <exception cref="ArgumentNullException">filename</exception>public virtual bool IsShortcut(string filename){if (string.IsNullOrEmpty(filename))@@ -118,7 +118,7 @@ namespace Emby.Server.Implementations.IO/// </summary>/// <param name="filename">The filename.</param>/// <returns>System.String.</returns>- /// <exception cref="System.ArgumentNullException">filename</exception>+ /// <exception cref="ArgumentNullException">filename</exception>public virtual string ResolveShortcut(string filename){if (string.IsNullOrEmpty(filename))@@ -185,7 +185,7 @@ namespace Emby.Server.Implementations.IO/// </summary>/// <param name="shortcutPath">The shortcut path.</param>/// <param name="target">The target.</param>- /// <exception cref="System.ArgumentNullException">+ /// <exception cref="ArgumentNullException">/// shortcutPath/// or/// target@@ -344,7 +344,7 @@ namespace Emby.Server.Implementations.IO/// </summary>/// <param name="filename">The filename.</param>/// <returns>System.String.</returns>- /// <exception cref="System.ArgumentNullException">filename</exception>+ /// <exception cref="ArgumentNullException">filename</exception>public string GetValidFilename(string filename){var builder = new StringBuilder(filename);@@ -526,7 +526,7 @@ namespace Emby.Server.Implementations.IO}else{- FileAttributes attributes = File.GetAttributes(path);+ var attributes = File.GetAttributes(path);attributes = RemoveAttribute(attributes, FileAttributes.Hidden);File.SetAttributes(path, attributes);}@@ -550,7 +550,7 @@ namespace Emby.Server.Implementations.IO}else{- FileAttributes attributes = File.GetAttributes(path);+ var attributes = File.GetAttributes(path);attributes = RemoveAttribute(attributes, FileAttributes.ReadOnly);File.SetAttributes(path, attributes);}diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.csindex 9c2759f133..0d25cbc92c 100644--- a/Emby.Server.Implementations/Library/LibraryManager.cs+++ b/Emby.Server.Implementations/Library/LibraryManager.cs@@ -711,7 +711,7 @@ namespace Emby.Server.Implementations.Library/// Creates the root media folder/// </summary>/// <returns>AggregateFolder.</returns>- /// <exception cref="System.InvalidOperationException">Cannot create the root folder until plugins have loaded</exception>+ /// <exception cref="InvalidOperationException">Cannot create the root folder until plugins have loaded</exception>public AggregateFolder CreateRootFolder(){var rootFolderPath = ConfigurationManager.ApplicationPaths.RootFolderPath;@@ -905,7 +905,7 @@ namespace Emby.Server.Implementations.Library/// </summary>/// <param name="value">The value.</param>/// <returns>Task{Year}.</returns>- /// <exception cref="System.ArgumentOutOfRangeException"></exception>+ /// <exception cref="ArgumentOutOfRangeException"></exception>public Year GetYear(int value){if (value <= 0)@@ -1233,7 +1233,7 @@ namespace Emby.Server.Implementations.Library/// </summary>/// <param name="id">The id.</param>/// <returns>BaseItem.</returns>- /// <exception cref="System.ArgumentNullException">id</exception>+ /// <exception cref="ArgumentNullException">id</exception>public BaseItem GetItemById(Guid id){if (id.Equals(Guid.Empty))@@ -2075,7 +2075,7 @@ namespace Emby.Server.Implementations.Librarypublic string GetConfiguredContentType(BaseItem item, bool inheritConfiguredPath){- ICollectionFolder collectionFolder = item as ICollectionFolder;+ var collectionFolder = item as ICollectionFolder;if (collectionFolder != null){return collectionFolder.CollectionType;@@ -2417,11 +2417,11 @@ namespace Emby.Server.Implementations.Libraryvar episodeInfo = episode.IsFileProtocol ?resolver.Resolve(episode.Path, isFolder, null, null, isAbsoluteNaming) :- new Emby.Naming.TV.EpisodeInfo();+ new Naming.TV.EpisodeInfo();if (episodeInfo == null){- episodeInfo = new Emby.Naming.TV.EpisodeInfo();+ episodeInfo = new Naming.TV.EpisodeInfo();}var changed = false;diff --git a/Emby.Server.Implementations/Library/MediaSourceManager.cs b/Emby.Server.Implementations/Library/MediaSourceManager.csindex dcda957421..fb0f33a2f6 100644--- a/Emby.Server.Implementations/Library/MediaSourceManager.cs+++ b/Emby.Server.Implementations/Library/MediaSourceManager.cs@@ -127,7 +127,7 @@ namespace Emby.Server.Implementations.Libraryif (allowMediaProbe && mediaSources[0].Type != MediaSourceType.Placeholder && !mediaSources[0].MediaStreams.Any(i => i.Type == MediaStreamType.Audio || i.Type == MediaStreamType.Video)){- await item.RefreshMetadata(new MediaBrowser.Controller.Providers.MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem))+ await item.RefreshMetadata(new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem)){EnableRemoteContentProbe = true,MetadataRefreshMode = MediaBrowser.Controller.Providers.MetadataRefreshMode.FullRefreshdiff --git a/Emby.Server.Implementations/Library/PathExtensions.cs b/Emby.Server.Implementations/Library/PathExtensions.csindex 6a3adda5a8..d3a81f6228 100644--- a/Emby.Server.Implementations/Library/PathExtensions.cs+++ b/Emby.Server.Implementations/Library/PathExtensions.cs@@ -11,7 +11,7 @@ namespace Emby.Server.Implementations.Library/// <param name="str">The STR.</param>/// <param name="attrib">The attrib.</param>/// <returns>System.String.</returns>- /// <exception cref="System.ArgumentNullException">attrib</exception>+ /// <exception cref="ArgumentNullException">attrib</exception>public static string GetAttributeValue(this string str, string attrib){if (string.IsNullOrEmpty(str))diff --git a/Emby.Server.Implementations/Library/ResolverHelper.cs b/Emby.Server.Implementations/Library/ResolverHelper.csindex 7484fc7430..96d1bff92c 100644--- a/Emby.Server.Implementations/Library/ResolverHelper.cs+++ b/Emby.Server.Implementations/Library/ResolverHelper.cs@@ -21,7 +21,7 @@ namespace Emby.Server.Implementations.Library/// <param name="fileSystem">The file system.</param>/// <param name="libraryManager">The library manager.</param>/// <param name="directoryService">The directory service.</param>- /// <exception cref="System.ArgumentException">Item must have a path</exception>+ /// <exception cref="ArgumentException">Item must have a path</exception>public static void SetInitialItemValues(BaseItem item, Folder parent, IFileSystem fileSystem, ILibraryManager libraryManager, IDirectoryService directoryService){// This version of the below method has no ItemResolveArgs, so we have to require the path already being setdiff --git a/Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs b/Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.csindex bd5132c4b3..d992f8d030 100644--- a/Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs+++ b/Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs@@ -49,7 +49,7 @@ namespace Emby.Server.Implementations.Library.Resolversvar namingOptions = ((LibraryManager)LibraryManager).GetNamingOptions();// If the path is a file check for a matching extensions- var parser = new Emby.Naming.Video.VideoResolver(namingOptions);+ var parser = new VideoResolver(namingOptions);if (args.IsDirectory){diff --git a/Emby.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs b/Emby.Server.Implementations/Library/Resolvers/TV/SeasonResolver.csindex a806c842fe..ce1386e91a 100644--- a/Emby.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs+++ b/Emby.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs@@ -63,7 +63,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.TVif (!season.IndexNumber.HasValue || !seasonParserResult.IsSeasonFolder){- var resolver = new Emby.Naming.TV.EpisodeResolver(namingOptions);+ var resolver = new Naming.TV.EpisodeResolver(namingOptions);var folderName = System.IO.Path.GetFileName(path);var testPath = "\\\\test\\" + folderName;diff --git a/Emby.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs b/Emby.Server.Implementations/Library/Resolvers/TV/SeriesResolver.csindex 3bd5b78a5c..16b5a2d3ae 100644--- a/Emby.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs+++ b/Emby.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs@@ -151,7 +151,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.TVvar namingOptions = ((LibraryManager)libraryManager).GetNamingOptions();- var episodeResolver = new Emby.Naming.TV.EpisodeResolver(namingOptions);+ var episodeResolver = new Naming.TV.EpisodeResolver(namingOptions);bool? isNamed = null;bool? isOptimistic = null;@@ -179,7 +179,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV/// </summary>/// <param name="path">The path.</param>/// <returns><c>true</c> if [is place holder] [the specified path]; otherwise, <c>false</c>.</returns>- /// <exception cref="System.ArgumentNullException">path</exception>+ /// <exception cref="ArgumentNullException">path</exception>private static bool IsVideoPlaceHolder(string path){if (string.IsNullOrEmpty(path))diff --git a/Emby.Server.Implementations/Library/SearchEngine.cs b/Emby.Server.Implementations/Library/SearchEngine.csindex 06f76311ce..71638b1978 100644--- a/Emby.Server.Implementations/Library/SearchEngine.cs+++ b/Emby.Server.Implementations/Library/SearchEngine.cs@@ -76,7 +76,7 @@ namespace Emby.Server.Implementations.Library/// <param name="query">The query.</param>/// <param name="user">The user.</param>/// <returns>IEnumerable{SearchHintResult}.</returns>- /// <exception cref="System.ArgumentNullException">searchTerm</exception>+ /// <exception cref="ArgumentNullException">searchTerm</exception>private List<SearchHintInfo> GetSearchHints(SearchQuery query, User user){var searchTerm = query.SearchTerm;diff --git a/Emby.Server.Implementations/Library/UserDataManager.cs b/Emby.Server.Implementations/Library/UserDataManager.csindex f2921e3543..dfa1edaffd 100644--- a/Emby.Server.Implementations/Library/UserDataManager.cs+++ b/Emby.Server.Implementations/Library/UserDataManager.cs@@ -193,7 +193,7 @@ namespace Emby.Server.Implementations.Library/// </summary>/// <param name="data">The data.</param>/// <returns>DtoUserItemData.</returns>- /// <exception cref="System.ArgumentNullException"></exception>+ /// <exception cref="ArgumentNullException"></exception>private UserItemDataDto GetUserItemDataDto(UserItemData data){if (data == null)diff --git a/Emby.Server.Implementations/Library/UserManager.cs b/Emby.Server.Implementations/Library/UserManager.csindex e4c9f775ea..f06c713866 100644--- a/Emby.Server.Implementations/Library/UserManager.cs+++ b/Emby.Server.Implementations/Library/UserManager.cs@@ -158,7 +158,7 @@ namespace Emby.Server.Implementations.Library/// </summary>/// <param name="id">The id.</param>/// <returns>User.</returns>- /// <exception cref="System.ArgumentNullException"></exception>+ /// <exception cref="ArgumentNullException"></exception>public User GetUserById(Guid id){if (id.Equals(Guid.Empty))@@ -619,8 +619,8 @@ namespace Emby.Server.Implementations.Library/// <param name="user">The user.</param>/// <param name="newName">The new name.</param>/// <returns>Task.</returns>- /// <exception cref="System.ArgumentNullException">user</exception>- /// <exception cref="System.ArgumentException"></exception>+ /// <exception cref="ArgumentNullException">user</exception>+ /// <exception cref="ArgumentException"></exception>public async Task RenameUser(User user, string newName){if (user == null)@@ -652,8 +652,8 @@ namespace Emby.Server.Implementations.Library/// Updates the user./// </summary>/// <param name="user">The user.</param>- /// <exception cref="System.ArgumentNullException">user</exception>- /// <exception cref="System.ArgumentException"></exception>+ /// <exception cref="ArgumentNullException">user</exception>+ /// <exception cref="ArgumentException"></exception>public void UpdateUser(User user){if (user == null)@@ -683,8 +683,8 @@ namespace Emby.Server.Implementations.Library/// </summary>/// <param name="name">The name.</param>/// <returns>User.</returns>- /// <exception cref="System.ArgumentNullException">name</exception>- /// <exception cref="System.ArgumentException"></exception>+ /// <exception cref="ArgumentNullException">name</exception>+ /// <exception cref="ArgumentException"></exception>public async Task<User> CreateUser(string name){if (string.IsNullOrWhiteSpace(name))@@ -731,8 +731,8 @@ namespace Emby.Server.Implementations.Library/// </summary>/// <param name="user">The user.</param>/// <returns>Task.</returns>- /// <exception cref="System.ArgumentNullException">user</exception>- /// <exception cref="System.ArgumentException"></exception>+ /// <exception cref="ArgumentNullException">user</exception>+ /// <exception cref="ArgumentException"></exception>public async Task DeleteUser(User user){if (user == null)diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.csindex 909e6eaeed..0ee53281df 100644--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs@@ -478,7 +478,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTVprivate static string GetMappedChannel(string channelId, NameValuePair[] mappings){- foreach (NameValuePair mapping in mappings)+ foreach (var mapping in mappings){if (StringHelper.EqualsIgnoreCase(mapping.Name, channelId)){@@ -2002,7 +2002,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTVCloseOutput = false};- using (XmlWriter writer = XmlWriter.Create(stream, settings))+ using (var writer = XmlWriter.Create(stream, settings)){writer.WriteStartDocument(true);writer.WriteStartElement("tvshow");@@ -2069,7 +2069,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTVvar isSeriesEpisode = timer.IsProgramSeries;- using (XmlWriter writer = XmlWriter.Create(stream, settings))+ using (var writer = XmlWriter.Create(stream, settings)){writer.WriteStartDocument(true);diff --git a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.csindex 25ad02e5d5..05d92dfcb8 100644--- a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs+++ b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs@@ -42,7 +42,7 @@ namespace Emby.Server.Implementations.LiveTv.Listingsprivate static List<string> GetScheduleRequestDates(DateTime startDateUtc, DateTime endDateUtc){- List<string> dates = new List<string>();+ var dates = new List<string>();var start = new List<DateTime> { startDateUtc, startDateUtc.ToLocalTime() }.Min().Date;var end = new List<DateTime> { endDateUtc, endDateUtc.ToLocalTime() }.Max().Date;@@ -104,7 +104,7 @@ namespace Emby.Server.Implementations.LiveTv.ListingshttpOptions.RequestHeaders["token"] = token;using (var response = await Post(httpOptions, true, info).ConfigureAwait(false))- using (StreamReader reader = new StreamReader(response.Content))+ using (var reader = new StreamReader(response.Content)){var dailySchedules = await _jsonSerializer.DeserializeFromStreamAsync<List<ScheduleDirect.Day>>(response.Content).ConfigureAwait(false);_logger.LogDebug("Found {ScheduleCount} programs on {ChannelID} ScheduleDirect", dailySchedules.Count, channelId);@@ -125,7 +125,7 @@ namespace Emby.Server.Implementations.LiveTv.ListingshttpOptions.RequestContent = "[\"" + string.Join("\", \"", programsID) + "\"]";using (var innerResponse = await Post(httpOptions, true, info).ConfigureAwait(false))- using (StreamReader innerReader = new StreamReader(innerResponse.Content))+ using (var innerReader = new StreamReader(innerResponse.Content)){var programDetails = await _jsonSerializer.DeserializeFromStreamAsync<List<ScheduleDirect.ProgramDetails>>(innerResponse.Content).ConfigureAwait(false);var programDict = programDetails.ToDictionary(p => p.programID, y => y);@@ -136,8 +136,8 @@ namespace Emby.Server.Implementations.LiveTv.Listingsvar images = await GetImageForPrograms(info, programIdsWithImages, cancellationToken).ConfigureAwait(false);- List<ProgramInfo> programsInfo = new List<ProgramInfo>();- foreach (ScheduleDirect.Program schedule in dailySchedules.SelectMany(d => d.programs))+ var programsInfo = new List<ProgramInfo>();+ foreach (var schedule in dailySchedules.SelectMany(d => d.programs)){//_logger.LogDebug("Proccesing Schedule for statio ID " + stationID +// " which corresponds to channel " + channelNumber + " and program id " +@@ -222,9 +222,9 @@ namespace Emby.Server.Implementations.LiveTv.Listingsprivate ProgramInfo GetProgram(string channelId, ScheduleDirect.Program programInfo, ScheduleDirect.ProgramDetails details){- DateTime startAt = GetDate(programInfo.airDateTime);- DateTime endAt = startAt.AddSeconds(programInfo.duration);- ProgramAudio audioType = ProgramAudio.Stereo;+ var startAt = GetDate(programInfo.airDateTime);+ var endAt = startAt.AddSeconds(programInfo.duration);+ var audioType = ProgramAudio.Stereo;var programId = programInfo.programID ?? string.Empty;@@ -526,15 +526,15 @@ namespace Emby.Server.Implementations.LiveTv.Listingstry{using (var httpResponse = await Get(options, false, info).ConfigureAwait(false))- using (Stream responce = httpResponse.Content)+ using (var responce = httpResponse.Content){var root = await _jsonSerializer.DeserializeFromStreamAsync<List<ScheduleDirect.Headends>>(responce).ConfigureAwait(false);if (root != null){- foreach (ScheduleDirect.Headends headend in root)+ foreach (var headend in root){- foreach (ScheduleDirect.Lineup lineup in headend.lineups)+ foreach (var lineup in headend.lineups){lineups.Add(new NameIdPair{@@ -887,7 +887,7 @@ namespace Emby.Server.Implementations.LiveTv.Listingsvar allStations = root.stations ?? Enumerable.Empty<ScheduleDirect.Station>();- foreach (ScheduleDirect.Map map in root.map)+ foreach (var map in root.map){var channelNumber = GetChannelNumber(map);diff --git a/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs b/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.csindex 2b1ee84a8a..0cbfbe0b40 100644--- a/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs+++ b/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs@@ -269,7 +269,7 @@ namespace Jellyfin.Server.Implementations.LiveTv.Listingsstring path = await GetXml(info.Path, CancellationToken.None).ConfigureAwait(false);_logger.LogDebug("Opening XmlTvReader for {path}", path);var reader = new XmlTvReader(path, GetLanguage(info));- IEnumerable<XmlTvChannel> results = reader.GetChannels();+ var results = reader.GetChannels();// Should this method be async?return results.Select(c => new NameIdPair() { Id = c.Id, Name = c.DisplayName }).ToList();@@ -281,7 +281,7 @@ namespace Jellyfin.Server.Implementations.LiveTv.Listingsstring path = await GetXml(info.Path, cancellationToken).ConfigureAwait(false);_logger.LogDebug("Opening XmlTvReader for {path}", path);var reader = new XmlTvReader(path, GetLanguage(info));- IEnumerable<XmlTvChannel> results = reader.GetChannels();+ var results = reader.GetChannels();// Should this method be async?return results.Select(c => new ChannelInfodiff --git a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs b/Emby.Server.Implementations/LiveTv/LiveTvManager.csindex 4ad58c7e47..3799271919 100644--- a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs+++ b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs@@ -242,7 +242,7 @@ namespace Emby.Server.Implementations.LiveTvvar channel = (LiveTvChannel)_libraryManager.GetItemById(id);bool isVideo = channel.ChannelType == ChannelType.TV;- ILiveTvService service = GetService(channel);+ var service = GetService(channel);_logger.LogInformation("Opening channel stream from {0}, external channel Id: {1}", service.Name, channel.ExternalId);MediaSourceInfo info;@@ -892,7 +892,7 @@ namespace Emby.Server.Implementations.LiveTvvar programList = _libraryManager.QueryItems(internalQuery).Items;var totalCount = programList.Length;- IOrderedEnumerable<LiveTvProgram> orderedPrograms = programList.Cast<LiveTvProgram>().OrderBy(i => i.StartDate.Date);+ var orderedPrograms = programList.Cast<LiveTvProgram>().OrderBy(i => i.StartDate.Date);if (query.IsAiring ?? false){@@ -2302,7 +2302,7 @@ namespace Emby.Server.Implementations.LiveTv// ServerConfiguration.SaveConfiguration crashes during xml serialization for AddListingProviderinfo = _jsonSerializer.DeserializeFromString<ListingsProviderInfo>(_jsonSerializer.SerializeToString(info));- IListingsProvider provider = _listingProviders.FirstOrDefault(i => string.Equals(info.Type, i.Type, StringComparison.OrdinalIgnoreCase));+ var provider = _listingProviders.FirstOrDefault(i => string.Equals(info.Type, i.Type, StringComparison.OrdinalIgnoreCase));if (provider == null){@@ -2313,9 +2313,9 @@ namespace Emby.Server.Implementations.LiveTvawait provider.Validate(info, validateLogin, validateListings).ConfigureAwait(false);- LiveTvOptions config = GetConfiguration();+ var config = GetConfiguration();- List<ListingsProviderInfo> list = config.ListingProviders.ToList();+ var list = config.ListingProviders.ToList();int index = list.FindIndex(i => string.Equals(i.Id, info.Id, StringComparison.OrdinalIgnoreCase));if (index == -1 || string.IsNullOrWhiteSpace(info.Id))diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.csindex 3714a03210..36f688c43a 100644--- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs@@ -262,7 +262,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerunvar name = string.Format("Tuner {0}", i + 1);var currentChannel = "none"; /// @todo Get current channel and map back to Station Idvar isAvailable = await manager.CheckTunerAvailability(ipInfo, i, cancellationToken).ConfigureAwait(false);- LiveTvTunerStatus status = isAvailable ? LiveTvTunerStatus.Available : LiveTvTunerStatus.LiveTv;+ var status = isAvailable ? LiveTvTunerStatus.Available : LiveTvTunerStatus.LiveTv;tuners.Add(new LiveTvTunerInfo{Name = name,diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunManager.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunManager.csindex 1ec5894d06..67eeec21dd 100644--- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunManager.cs+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunManager.cs@@ -173,7 +173,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomeruncontinue;var commandList = commands.GetCommands();- foreach (Tuple<string, string> command in commandList)+ foreach (var command in commandList){var channelMsg = CreateSetMessage(i, command.Item1, command.Item2, lockKeyValue);await tcpClient.SendToAsync(channelMsg, 0, channelMsg.Length, ipEndPoint, cancellationToken).ConfigureAwait(false);@@ -216,7 +216,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerunvar commandList = commands.GetCommands();var receiveBuffer = new byte[8192];- foreach (Tuple<string, string> command in commandList)+ foreach (var 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);diff --git a/Emby.Server.Implementations/Net/DisposableManagedObjectBase.cs b/Emby.Server.Implementations/Net/DisposableManagedObjectBase.csindex 9d880b0c95..304b445651 100644--- a/Emby.Server.Implementations/Net/DisposableManagedObjectBase.cs+++ b/Emby.Server.Implementations/Net/DisposableManagedObjectBase.cs@@ -19,10 +19,10 @@ namespace Emby.Server.Implementations.Net//TODO Remove and reimplement using the IsDisposed property directly./// <summary>- /// Throws an <see cref="System.ObjectDisposedException"/> if the <see cref="IsDisposed"/> property is true.+ /// Throws an <see cref="ObjectDisposedException"/> if the <see cref="IsDisposed"/> property is true./// </summary>/// <seealso cref="IsDisposed"/>- /// <exception cref="System.ObjectDisposedException">Thrown if the <see cref="IsDisposed"/> property is true.</exception>+ /// <exception cref="ObjectDisposedException">Thrown if the <see cref="IsDisposed"/> property is true.</exception>/// <seealso cref="Dispose()"/>protected virtual void ThrowIfDisposed(){diff --git a/Emby.Server.Implementations/Net/UdpSocket.cs b/Emby.Server.Implementations/Net/UdpSocket.csindex cdfdb72108..d488554860 100644--- a/Emby.Server.Implementations/Net/UdpSocket.cs+++ b/Emby.Server.Implementations/Net/UdpSocket.cs@@ -133,8 +133,8 @@ namespace Emby.Server.Implementations.Net{ThrowIfDisposed();- IPEndPoint sender = new IPEndPoint(IPAddress.Any, 0);- EndPoint remoteEndPoint = (EndPoint)sender;+ var sender = new IPEndPoint(IPAddress.Any, 0);+ var remoteEndPoint = (EndPoint)sender;var receivedBytes = _Socket.EndReceiveFrom(result, ref remoteEndPoint);diff --git a/Emby.Server.Implementations/Networking/IPNetwork/BigIntegerExt.cs b/Emby.Server.Implementations/Networking/IPNetwork/BigIntegerExt.csindex 1a2ad665ba..447cbf4034 100644--- a/Emby.Server.Implementations/Networking/IPNetwork/BigIntegerExt.cs+++ b/Emby.Server.Implementations/Networking/IPNetwork/BigIntegerExt.cs@@ -7,7 +7,7 @@ namespace System.Netusing System.Text;/// <summary>- /// Extension methods to convert <see cref="System.Numerics.BigInteger"/>+ /// Extension methods to convert <see cref="BigInteger"/>/// instances to hexadecimal, octal, and binary strings./// </summary>public static class BigIntegerExtensions@@ -17,7 +17,7 @@ namespace System.Net/// </summary>/// <param name="bigint">A <see cref="BigInteger"/>.</param>/// <returns>- /// A <see cref="System.String"/> containing a binary+ /// A <see cref="string"/> containing a binary/// representation of the supplied <see cref="BigInteger"/>./// </returns>public static string ToBinaryString(this BigInteger bigint)@@ -54,7 +54,7 @@ namespace System.Net/// </summary>/// <param name="bigint">A <see cref="BigInteger"/>.</param>/// <returns>- /// A <see cref="System.String"/> containing a hexadecimal+ /// A <see cref="string"/> containing a hexadecimal/// representation of the supplied <see cref="BigInteger"/>./// </returns>public static string ToHexadecimalString(this BigInteger bigint)@@ -67,7 +67,7 @@ namespace System.Net/// </summary>/// <param name="bigint">A <see cref="BigInteger"/>.</param>/// <returns>- /// A <see cref="System.String"/> containing an octal+ /// A <see cref="string"/> containing an octal/// representation of the supplied <see cref="BigInteger"/>./// </returns>public static string ToOctalString(this BigInteger bigint)diff --git a/Emby.Server.Implementations/Networking/IPNetwork/IPAddressCollection.cs b/Emby.Server.Implementations/Networking/IPNetwork/IPAddressCollection.csindex c2a6305f6f..c5853135cd 100644--- a/Emby.Server.Implementations/Networking/IPNetwork/IPAddressCollection.cs+++ b/Emby.Server.Implementations/Networking/IPNetwork/IPAddressCollection.cs@@ -30,7 +30,7 @@ namespace System.Netthrow new ArgumentOutOfRangeException(nameof(i));}byte width = this._ipnetwork.AddressFamily == Sockets.AddressFamily.InterNetwork ? (byte)32 : (byte)128;- IPNetworkCollection ipn = this._ipnetwork.Subnet(width);+ var ipn = this._ipnetwork.Subnet(width);return ipn[i].Network;}}diff --git a/Emby.Server.Implementations/Networking/IPNetwork/IPNetwork.cs b/Emby.Server.Implementations/Networking/IPNetwork/IPNetwork.csindex 321d4a3c52..21feaea33d 100644--- a/Emby.Server.Implementations/Networking/IPNetwork/IPNetwork.cs+++ b/Emby.Server.Implementations/Networking/IPNetwork/IPNetwork.cs@@ -33,7 +33,7 @@ namespace System.Net{get{- BigInteger uintNetwork = this._ipaddress & this._netmask;+ var uintNetwork = this._ipaddress & this._netmask;return uintNetwork;}}@@ -61,7 +61,7 @@ namespace System.Net{int width = this._family == Sockets.AddressFamily.InterNetwork ? 4 : 16;- BigInteger uintBroadcast = this._network + this._netmask.PositiveReverse(width);+ var uintBroadcast = this._network + this._netmask.PositiveReverse(width);return uintBroadcast;}}@@ -88,7 +88,7 @@ namespace System.Net{get{- BigInteger fisrt = this._family == Sockets.AddressFamily.InterNetworkV6+ var fisrt = this._family == Sockets.AddressFamily.InterNetworkV6? this._network: (this.Usable <= 0) ? this._network : this._network + 1;return IPNetwork.ToIPAddress(fisrt, this._family);@@ -102,7 +102,7 @@ namespace System.Net{get{- BigInteger last = this._family == Sockets.AddressFamily.InterNetworkV6+ var last = this._family == Sockets.AddressFamily.InterNetworkV6? this._broadcast: (this.Usable <= 0) ? this._network : this._broadcast - 1;return IPNetwork.ToIPAddress(last, this._family);@@ -122,8 +122,8 @@ namespace System.Netreturn this.Total;}byte[] mask = new byte[] { 0xff, 0xff, 0xff, 0xff, 0x00 };- BigInteger bmask = new BigInteger(mask);- BigInteger usableIps = (_cidr > 30) ? 0 : ((bmask >> _cidr) - 1);+ var bmask = new BigInteger(mask);+ var usableIps = (_cidr > 30) ? 0 : ((bmask >> _cidr) - 1);return usableIps;}}@@ -137,7 +137,7 @@ namespace System.Net{int max = this._family == Sockets.AddressFamily.InterNetwork ? 32 : 128;- BigInteger count = BigInteger.Pow(2, (max - _cidr));+ var count = BigInteger.Pow(2, (max - _cidr));return count;}}@@ -523,7 +523,7 @@ namespace System.Netreturn;}- BigInteger uintIpAddress = IPNetwork.ToBigInteger(ipaddress);+ var uintIpAddress = IPNetwork.ToBigInteger(ipaddress);byte? cidr2 = null;bool parsed = IPNetwork.TryToCidr(netmask, out cidr2);if (parsed == false)@@ -537,7 +537,7 @@ namespace System.Net}byte cidr = (byte)cidr2;- IPNetwork ipnet = new IPNetwork(uintIpAddress, ipaddress.AddressFamily, cidr);+ var ipnet = new IPNetwork(uintIpAddress, ipaddress.AddressFamily, cidr);ipnetwork = ipnet;return;@@ -754,7 +754,7 @@ namespace System.Netreturn;}- BigInteger mask = new BigInteger(new byte[] {+ var mask = new BigInteger(new byte[] {0xff, 0xff, 0xff, 0xff,0xff, 0xff, 0xff, 0xff,0xff, 0xff, 0xff, 0xff,@@ -762,7 +762,7 @@ namespace System.Net0x00});- BigInteger masked = cidr == 0 ? 0 : mask << (128 - cidr);+ var masked = cidr == 0 ? 0 : mask << (128 - cidr);byte[] m = masked.ToByteArray();byte[] bmask = new byte[17];int copy = m.Length > 16 ? 16 : m.Length;@@ -858,7 +858,7 @@ namespace System.Net/// cidr = null;/// return;/// }- BigInteger uintNetmask = (BigInteger)uintNetmask2;+ var uintNetmask = (BigInteger)uintNetmask2;byte? cidr2 = null;IPNetwork.InternalToCidr(tryParse, uintNetmask, netmask.AddressFamily, out cidr2);@@ -951,8 +951,8 @@ namespace System.Netreturn;}- BigInteger mask = IPNetwork.ToUint(cidr, family);- IPAddress netmask2 = IPNetwork.ToIPAddress(mask, family);+ var mask = IPNetwork.ToUint(cidr, family);+ var netmask2 = IPNetwork.ToIPAddress(mask, family);netmask = netmask2;return;@@ -990,7 +990,7 @@ namespace System.Net/// <returns></returns>public static uint BitsSet(IPAddress netmask){- BigInteger uintNetmask = IPNetwork.ToBigInteger(netmask);+ var uintNetmask = IPNetwork.ToBigInteger(netmask);uint bits = IPNetwork.BitsSet(uintNetmask, netmask.AddressFamily);return bits;}@@ -1013,7 +1013,7 @@ namespace System.Net{throw new ArgumentNullException(nameof(netmask));}- BigInteger uintNetmask = IPNetwork.ToBigInteger(netmask);+ var uintNetmask = IPNetwork.ToBigInteger(netmask);bool valid = IPNetwork.InternalValidNetmask(uintNetmask, netmask.AddressFamily);return valid;}@@ -1042,7 +1042,7 @@ namespace System.Net0x00});- BigInteger neg = ((~netmask) & (mask));+ var neg = ((~netmask) & (mask));bool isNetmask = ((neg + 1) & neg) == 0;return isNetmask;@@ -1068,7 +1068,7 @@ namespace System.NetArray.Reverse(bytes2);byte[] sized = Resize(bytes2, family);- IPAddress ip = new IPAddress(sized);+ var ip = new IPAddress(sized);return ip;}@@ -1122,9 +1122,9 @@ namespace System.Netreturn false;}- BigInteger uintNetwork = _network;- BigInteger uintBroadcast = _broadcast;- BigInteger uintAddress = IPNetwork.ToBigInteger(ipaddress);+ var uintNetwork = _network;+ var uintBroadcast = _broadcast;+ var uintAddress = IPNetwork.ToBigInteger(ipaddress);bool contains = (uintAddress >= uintNetwork&& uintAddress <= uintBroadcast);@@ -1146,11 +1146,11 @@ namespace System.Netthrow new ArgumentNullException(nameof(network2));}- BigInteger uintNetwork = _network;- BigInteger uintBroadcast = _broadcast;+ var uintNetwork = _network;+ var uintBroadcast = _broadcast;- BigInteger uintFirst = network2._network;- BigInteger uintLast = network2._broadcast;+ var uintFirst = network2._network;+ var uintLast = network2._broadcast;bool contains = (uintFirst >= uintNetwork&& uintLast <= uintBroadcast);@@ -1175,11 +1175,11 @@ namespace System.Netthrow new ArgumentNullException(nameof(network2));}- BigInteger uintNetwork = _network;- BigInteger uintBroadcast = _broadcast;+ var uintNetwork = _network;+ var uintBroadcast = _broadcast;- BigInteger uintFirst = network2._network;- BigInteger uintLast = network2._broadcast;+ var uintFirst = network2._network;+ var uintLast = network2._broadcast;bool overlap =(uintFirst >= uintNetwork && uintFirst <= uintBroadcast)@@ -1428,8 +1428,8 @@ namespace System.Netreturn;}- IPNetwork first = (network1._network < network2._network) ? network1 : network2;- IPNetwork last = (network1._network > network2._network) ? network1 : network2;+ var first = (network1._network < network2._network) ? network1 : network2;+ var last = (network1._network > network2._network) ? network1 : network2;/// Starting from here :/// network1 and network2 have the same cidr,@@ -1449,10 +1449,10 @@ namespace System.Netreturn;}- BigInteger uintSupernet = first._network;+ var uintSupernet = first._network;byte cidrSupernet = (byte)(first._cidr - 1);- IPNetwork networkSupernet = new IPNetwork(uintSupernet, first._family, cidrSupernet);+ var networkSupernet = new IPNetwork(uintSupernet, first._family, cidrSupernet);if (networkSupernet._network != first._network){if (trySupernet == false)@@ -1535,9 +1535,9 @@ namespace System.Netreturn true;}- List<IPNetwork> supernetted = new List<IPNetwork>();- List<IPNetwork> ipns = IPNetwork.Array2List(ipnetworks);- Stack<IPNetwork> current = IPNetwork.List2Stack(ipns);+ var supernetted = new List<IPNetwork>();+ var ipns = IPNetwork.Array2List(ipnetworks);+ var current = IPNetwork.List2Stack(ipns);int previousCount = 0;int currentCount = current.Count;@@ -1547,8 +1547,8 @@ namespace System.Netsupernetted.Clear();while (current.Count > 1){- IPNetwork ipn1 = current.Pop();- IPNetwork ipn2 = current.Peek();+ var ipn1 = current.Pop();+ var ipn2 = current.Peek();IPNetwork outNetwork = null;bool success = ipn1.TrySupernet(ipn2, out outNetwork);@@ -1578,7 +1578,7 @@ namespace System.Netprivate static Stack<IPNetwork> List2Stack(List<IPNetwork> list){- Stack<IPNetwork> stack = new Stack<IPNetwork>();+ var stack = new Stack<IPNetwork>();list.ForEach(new Action<IPNetwork>(delegate (IPNetwork ipn){@@ -1590,7 +1590,7 @@ namespace System.Netprivate static List<IPNetwork> Array2List(IPNetwork[] array){- List<IPNetwork> ipns = new List<IPNetwork>();+ var ipns = new List<IPNetwork>();ipns.AddRange(array);IPNetwork.RemoveNull(ipns);ipns.Sort(new Comparison<IPNetwork>(@@ -1659,10 +1659,10 @@ namespace System.Netthrow new NotSupportedException("MixedAddressFamily");}- IPNetwork ipnetwork = new IPNetwork(0, startIP.AddressFamily, 0);+ var ipnetwork = new IPNetwork(0, startIP.AddressFamily, 0);for (byte cidr = 32; cidr >= 0; cidr--){- IPNetwork wideSubnet = IPNetwork.Parse(start, cidr);+ var wideSubnet = IPNetwork.Parse(start, cidr);if (wideSubnet.Contains(endIP)){ipnetwork = wideSubnet;@@ -1707,7 +1707,7 @@ namespace System.Net}- IPNetwork[] nnin = Array.FindAll<IPNetwork>(ipnetworks, new Predicate<IPNetwork>(+ IPNetwork[] nnin = Array.FindAll(ipnetworks, new Predicate<IPNetwork>(delegate (IPNetwork ipnet){return ipnet != null;@@ -1726,19 +1726,19 @@ namespace System.Netif (nnin.Length == 1){- IPNetwork ipn0 = nnin[0];+ var ipn0 = nnin[0];ipnetwork = ipn0;return;}- Array.Sort<IPNetwork>(nnin);- IPNetwork nnin0 = nnin[0];- BigInteger uintNnin0 = nnin0._ipaddress;+ Array.Sort(nnin);+ var nnin0 = nnin[0];+ var uintNnin0 = nnin0._ipaddress;- IPNetwork nninX = nnin[nnin.Length - 1];- IPAddress ipaddressX = nninX.Broadcast;+ var nninX = nnin[nnin.Length - 1];+ var ipaddressX = nninX.Broadcast;- AddressFamily family = ipnetworks[0]._family;+ var family = ipnetworks[0]._family;foreach (var ipnx in ipnetworks){if (ipnx._family != family)@@ -1747,10 +1747,10 @@ namespace System.Net}}- IPNetwork ipn = new IPNetwork(0, family, 0);+ var ipn = new IPNetwork(0, family, 0);for (byte cidr = nnin0._cidr; cidr >= 0; cidr--){- IPNetwork wideSubnet = new IPNetwork(uintNnin0, family, cidr);+ var wideSubnet = new IPNetwork(uintNnin0, family, cidr);if (wideSubnet.Contains(ipaddressX)){ipn = wideSubnet;@@ -1773,7 +1773,7 @@ namespace System.Netpublic string Print(){- StringWriter sw = new StringWriter();+ var sw = new StringWriter();sw.WriteLine("IPNetwork : {0}", ToString());sw.WriteLine("Network : {0}", Network);@@ -1819,7 +1819,7 @@ namespace System.Netcidr = 64;return true;}- BigInteger uintIPAddress = IPNetwork.ToBigInteger(ipaddress);+ var uintIPAddress = IPNetwork.ToBigInteger(ipaddress);uintIPAddress = uintIPAddress >> 29;if (uintIPAddress <= 3){diff --git a/Emby.Server.Implementations/Networking/IPNetwork/IPNetworkCollection.cs b/Emby.Server.Implementations/Networking/IPNetwork/IPNetworkCollection.csindex 1827af77aa..7d3106624a 100644--- a/Emby.Server.Implementations/Networking/IPNetwork/IPNetworkCollection.cs+++ b/Emby.Server.Implementations/Networking/IPNetwork/IPNetworkCollection.cs@@ -47,7 +47,7 @@ namespace System.Net{get{- BigInteger count = BigInteger.Pow(2, this._cidrSubnet - this._cidr);+ var count = BigInteger.Pow(2, this._cidrSubnet - this._cidr);return count;}}@@ -61,11 +61,11 @@ namespace System.Netthrow new ArgumentOutOfRangeException(nameof(i));}- BigInteger last = this._ipnetwork.AddressFamily == Sockets.AddressFamily.InterNetworkV6+ var last = this._ipnetwork.AddressFamily == Sockets.AddressFamily.InterNetworkV6? this._lastUsable : this._broadcast;- BigInteger increment = (last - this._network) / this.Count;- BigInteger uintNetwork = this._network + ((increment + 1) * i);- IPNetwork ipn = new IPNetwork(uintNetwork, this._ipnetwork.AddressFamily, this._cidrSubnet);+ var increment = (last - this._network) / this.Count;+ var uintNetwork = this._network + ((increment + 1) * i);+ var ipn = new IPNetwork(uintNetwork, this._ipnetwork.AddressFamily, this._cidrSubnet);return ipn;}}diff --git a/Emby.Server.Implementations/Networking/NetworkManager.cs b/Emby.Server.Implementations/Networking/NetworkManager.csindex 568981abbe..70d8376a97 100644--- a/Emby.Server.Implementations/Networking/NetworkManager.cs+++ b/Emby.Server.Implementations/Networking/NetworkManager.cs@@ -214,9 +214,9 @@ namespace Emby.Server.Implementations.Networkingsubnets = new List<string>();- foreach (NetworkInterface adapter in NetworkInterface.GetAllNetworkInterfaces())+ foreach (var adapter in NetworkInterface.GetAllNetworkInterfaces()){- foreach (UnicastIPAddressInformation unicastIPAddressInformation in adapter.GetIPProperties().UnicastAddresses)+ foreach (var unicastIPAddressInformation in adapter.GetIPProperties().UnicastAddresses){if (unicastIPAddressInformation.Address.AddressFamily == AddressFamily.InterNetwork && endpointFirstPart == unicastIPAddressInformation.Address.ToString().Split('.')[0]){@@ -461,7 +461,7 @@ namespace Emby.Server.Implementations.Networkingpublic int GetRandomUnusedUdpPort(){- IPEndPoint localEndPoint = new IPEndPoint(IPAddress.Any, 0);+ var localEndPoint = new IPEndPoint(IPAddress.Any, 0);using (var udpClient = new UdpClient(localEndPoint)){var port = ((IPEndPoint)(udpClient.Client.LocalEndPoint)).Port;@@ -522,8 +522,8 @@ namespace Emby.Server.Implementations.Networking/// <param name="endpointstring">The endpointstring.</param>/// <param name="defaultport">The defaultport.</param>/// <returns>IPEndPoint.</returns>- /// <exception cref="System.ArgumentException">Endpoint descriptor may not be empty.</exception>- /// <exception cref="System.FormatException"></exception>+ /// <exception cref="ArgumentException">Endpoint descriptor may not be empty.</exception>+ /// <exception cref="FormatException"></exception>private static async Task<IPEndPoint> Parse(string endpointstring, int defaultport){if (string.IsNullOrEmpty(endpointstring)@@ -585,7 +585,7 @@ namespace Emby.Server.Implementations.Networking/// </summary>/// <param name="p">The p.</param>/// <returns>System.Int32.</returns>- /// <exception cref="System.FormatException"></exception>+ /// <exception cref="FormatException"></exception>private static int GetPort(string p){int port;@@ -605,7 +605,7 @@ namespace Emby.Server.Implementations.Networking/// </summary>/// <param name="p">The p.</param>/// <returns>IPAddress.</returns>- /// <exception cref="System.ArgumentException"></exception>+ /// <exception cref="ArgumentException"></exception>private static async Task<IPAddress> GetIPfromHost(string p){var hosts = await Dns.GetHostAddressesAsync(p).ConfigureAwait(false);diff --git a/Emby.Server.Implementations/Playlists/PlaylistManager.cs b/Emby.Server.Implementations/Playlists/PlaylistManager.csindex 6dbefa9103..c39897b53e 100644--- a/Emby.Server.Implementations/Playlists/PlaylistManager.cs+++ b/Emby.Server.Implementations/Playlists/PlaylistManager.cs@@ -469,12 +469,12 @@ namespace Emby.Server.Implementations.PlaylistsfolderPath = folderPath + Path.DirectorySeparatorChar;}- Uri folderUri = new Uri(folderPath);- Uri fileAbsoluteUri = new Uri(fileAbsolutePath);+ var folderUri = new Uri(folderPath);+ var fileAbsoluteUri = new Uri(fileAbsolutePath);if (folderUri.Scheme != fileAbsoluteUri.Scheme) { return fileAbsolutePath; } // path can't be made relative.- Uri relativeUri = folderUri.MakeRelativeUri(fileAbsoluteUri);+ var relativeUri = folderUri.MakeRelativeUri(fileAbsoluteUri);string relativePath = Uri.UnescapeDataString(relativeUri.ToString());if (fileAbsoluteUri.Scheme.Equals("file", StringComparison.CurrentCultureIgnoreCase))diff --git a/Emby.Server.Implementations/ScheduledTasks/ScheduledTaskWorker.cs b/Emby.Server.Implementations/ScheduledTasks/ScheduledTaskWorker.csindex dc60b9990f..44f6e2d7b3 100644--- a/Emby.Server.Implementations/ScheduledTasks/ScheduledTaskWorker.cs+++ b/Emby.Server.Implementations/ScheduledTasks/ScheduledTaskWorker.cs@@ -63,7 +63,7 @@ namespace Emby.Server.Implementations.ScheduledTasks/// <param name="taskManager">The task manager.</param>/// <param name="jsonSerializer">The json serializer.</param>/// <param name="logger">The logger.</param>- /// <exception cref="System.ArgumentNullException">+ /// <exception cref="ArgumentNullException">/// scheduledTask/// or/// applicationPaths@@ -256,7 +256,7 @@ namespace Emby.Server.Implementations.ScheduledTasks/// Gets the triggers that define when the task will run/// </summary>/// <value>The triggers.</value>- /// <exception cref="System.ArgumentNullException">value</exception>+ /// <exception cref="ArgumentNullException">value</exception>public TaskTriggerInfo[] Triggers{get@@ -365,7 +365,7 @@ namespace Emby.Server.Implementations.ScheduledTasks/// </summary>/// <param name="options">Task options.</param>/// <returns>Task.</returns>- /// <exception cref="System.InvalidOperationException">Cannot execute a Task that is already running</exception>+ /// <exception cref="InvalidOperationException">Cannot execute a Task that is already running</exception>public async Task Execute(TaskOptions options){var task = Task.Run(async () => await ExecuteInternal(options).ConfigureAwait(false));@@ -461,7 +461,7 @@ namespace Emby.Server.Implementations.ScheduledTasks/// <summary>/// Stops the task if it is currently executing/// </summary>- /// <exception cref="System.InvalidOperationException">Cannot cancel a Task unless it is in the Running state.</exception>+ /// <exception cref="InvalidOperationException">Cannot cancel a Task unless it is in the Running state.</exception>public void Cancel(){if (State != TaskState.Running)@@ -705,8 +705,8 @@ namespace Emby.Server.Implementations.ScheduledTasks/// </summary>/// <param name="info">The info.</param>/// <returns>BaseTaskTrigger.</returns>- /// <exception cref="System.ArgumentNullException"></exception>- /// <exception cref="System.ArgumentException">Invalid trigger type: + info.Type</exception>+ /// <exception cref="ArgumentNullException"></exception>+ /// <exception cref="ArgumentException">Invalid trigger type: + info.Type</exception>private ITaskTrigger GetTrigger(TaskTriggerInfo info){var options = new TaskOptionsdiff --git a/Emby.Server.Implementations/ScheduledTasks/TaskManager.cs b/Emby.Server.Implementations/ScheduledTasks/TaskManager.csindex 754fb16336..ac47c9625b 100644--- a/Emby.Server.Implementations/ScheduledTasks/TaskManager.cs+++ b/Emby.Server.Implementations/ScheduledTasks/TaskManager.cs@@ -61,7 +61,7 @@ namespace Emby.Server.Implementations.ScheduledTasks/// <param name="applicationPaths">The application paths.</param>/// <param name="jsonSerializer">The json serializer.</param>/// <param name="logger">The logger.</param>- /// <exception cref="System.ArgumentException">kernel</exception>+ /// <exception cref="ArgumentException">kernel</exception>public TaskManager(IApplicationPaths applicationPaths, IJsonSerializer jsonSerializer, ILogger logger, IFileSystem fileSystem, ISystemEvents systemEvents){ApplicationPaths = applicationPaths;diff --git a/Emby.Server.Implementations/Security/EncryptionManager.cs b/Emby.Server.Implementations/Security/EncryptionManager.csindex c608723461..fa8872ccc3 100644--- a/Emby.Server.Implementations/Security/EncryptionManager.cs+++ b/Emby.Server.Implementations/Security/EncryptionManager.cs@@ -11,7 +11,7 @@ namespace Emby.Server.Implementations.Security/// </summary>/// <param name="value">The value.</param>/// <returns>System.String.</returns>- /// <exception cref="System.ArgumentNullException">value</exception>+ /// <exception cref="ArgumentNullException">value</exception>public string EncryptString(string value){if (value == null)@@ -27,7 +27,7 @@ namespace Emby.Server.Implementations.Security/// </summary>/// <param name="value">The value.</param>/// <returns>System.String.</returns>- /// <exception cref="System.ArgumentNullException">value</exception>+ /// <exception cref="ArgumentNullException">value</exception>public string DecryptString(string value){if (value == null)diff --git a/Emby.Server.Implementations/Serialization/JsonSerializer.cs b/Emby.Server.Implementations/Serialization/JsonSerializer.csindex 26c648d729..60bf2d5a9d 100644--- a/Emby.Server.Implementations/Serialization/JsonSerializer.cs+++ b/Emby.Server.Implementations/Serialization/JsonSerializer.cs@@ -27,7 +27,7 @@ namespace Emby.Common.Implementations.Serialization/// </summary>/// <param name="obj">The obj.</param>/// <param name="stream">The stream.</param>- /// <exception cref="System.ArgumentNullException">obj</exception>+ /// <exception cref="ArgumentNullException">obj</exception>public void SerializeToStream(object obj, Stream stream){if (obj == null)@@ -48,7 +48,7 @@ namespace Emby.Common.Implementations.Serialization/// </summary>/// <param name="obj">The obj.</param>/// <param name="file">The file.</param>- /// <exception cref="System.ArgumentNullException">obj</exception>+ /// <exception cref="ArgumentNullException">obj</exception>public void SerializeToFile(object obj, string file){if (obj == null)@@ -61,7 +61,7 @@ namespace Emby.Common.Implementations.Serializationthrow new ArgumentNullException(nameof(file));}- using (Stream stream = _fileSystem.GetFileStream(file, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read))+ using (var stream = _fileSystem.GetFileStream(file, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read)){SerializeToStream(obj, stream);}@@ -79,7 +79,7 @@ namespace Emby.Common.Implementations.Serialization/// <param name="type">The type.</param>/// <param name="file">The file.</param>/// <returns>System.Object.</returns>- /// <exception cref="System.ArgumentNullException">type</exception>+ /// <exception cref="ArgumentNullException">type</exception>public object DeserializeFromFile(Type type, string file){if (type == null)@@ -92,7 +92,7 @@ namespace Emby.Common.Implementations.Serializationthrow new ArgumentNullException(nameof(file));}- using (Stream stream = OpenFile(file))+ using (var stream = OpenFile(file)){return DeserializeFromStream(stream, type);}@@ -104,7 +104,7 @@ namespace Emby.Common.Implementations.Serialization/// <typeparam name="T"></typeparam>/// <param name="file">The file.</param>/// <returns>``0.</returns>- /// <exception cref="System.ArgumentNullException">file</exception>+ /// <exception cref="ArgumentNullException">file</exception>public T DeserializeFromFile<T>(string file)where T : class{@@ -113,7 +113,7 @@ namespace Emby.Common.Implementations.Serializationthrow new ArgumentNullException(nameof(file));}- using (Stream stream = OpenFile(file))+ using (var stream = OpenFile(file)){return DeserializeFromStream<T>(stream);}@@ -125,7 +125,7 @@ namespace Emby.Common.Implementations.Serialization/// <typeparam name="T"></typeparam>/// <param name="stream">The stream.</param>/// <returns>``0.</returns>- /// <exception cref="System.ArgumentNullException">stream</exception>+ /// <exception cref="ArgumentNullException">stream</exception>public T DeserializeFromStream<T>(Stream stream){if (stream == null)@@ -153,7 +153,7 @@ namespace Emby.Common.Implementations.Serialization/// <typeparam name="T"></typeparam>/// <param name="text">The text.</param>/// <returns>``0.</returns>- /// <exception cref="System.ArgumentNullException">text</exception>+ /// <exception cref="ArgumentNullException">text</exception>public T DeserializeFromString<T>(string text){if (string.IsNullOrEmpty(text))@@ -170,7 +170,7 @@ namespace Emby.Common.Implementations.Serialization/// <param name="stream">The stream.</param>/// <param name="type">The type.</param>/// <returns>System.Object.</returns>- /// <exception cref="System.ArgumentNullException">stream</exception>+ /// <exception cref="ArgumentNullException">stream</exception>public object DeserializeFromStream(Stream stream, Type type){if (stream == null)@@ -236,7 +236,7 @@ namespace Emby.Common.Implementations.Serialization/// <param name="json">The json.</param>/// <param name="type">The type.</param>/// <returns>System.Object.</returns>- /// <exception cref="System.ArgumentNullException">json</exception>+ /// <exception cref="ArgumentNullException">json</exception>public object DeserializeFromString(string json, Type type){if (string.IsNullOrEmpty(json))@@ -257,7 +257,7 @@ namespace Emby.Common.Implementations.Serialization/// </summary>/// <param name="obj">The obj.</param>/// <returns>System.String.</returns>- /// <exception cref="System.ArgumentNullException">obj</exception>+ /// <exception cref="ArgumentNullException">obj</exception>public string SerializeToString(object obj){if (obj == null)diff --git a/Emby.Server.Implementations/Services/ServiceController.cs b/Emby.Server.Implementations/Services/ServiceController.csindex f82c648238..b34832f45e 100644--- a/Emby.Server.Implementations/Services/ServiceController.cs+++ b/Emby.Server.Implementations/Services/ServiceController.cs@@ -72,7 +72,7 @@ namespace Emby.Server.Implementations.Servicespublic void RegisterRestPaths(HttpListenerHost appHost, Type requestType, Type serviceType){var attrs = appHost.GetRouteAttributes(requestType);- foreach (RouteAttribute attr in attrs)+ foreach (var attr in attrs){var restPath = new RestPath(appHost.CreateInstance, appHost.GetParseFn, requestType, serviceType, attr.Path, attr.Verbs, attr.IsHidden, attr.Summary, attr.Description);diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.csindex d991302280..e398b58cc9 100644--- a/Emby.Server.Implementations/Session/SessionManager.cs+++ b/Emby.Server.Implementations/Session/SessionManager.cs@@ -201,8 +201,8 @@ namespace Emby.Server.Implementations.Session/// <param name="remoteEndPoint">The remote end point.</param>/// <param name="user">The user.</param>/// <returns>Task.</returns>- /// <exception cref="System.ArgumentNullException">user</exception>- /// <exception cref="System.UnauthorizedAccessException"></exception>+ /// <exception cref="ArgumentNullException">user</exception>+ /// <exception cref="UnauthorizedAccessException"></exception>public SessionInfo LogSessionActivity(string appName,string appVersion,string deviceId,@@ -365,7 +365,7 @@ namespace Emby.Server.Implementations.Session/// Removes the now playing item id./// </summary>/// <param name="session">The session.</param>- /// <exception cref="System.ArgumentNullException">item</exception>+ /// <exception cref="ArgumentNullException">item</exception>private void RemoveNowPlayingItem(SessionInfo session){session.NowPlayingItem = null;@@ -404,7 +404,7 @@ namespace Emby.Server.Implementations.SessionCheckDisposed();- SessionInfo sessionInfo = _activeConnections.GetOrAdd(key, k =>+ var sessionInfo = _activeConnections.GetOrAdd(key, k =>{return CreateSession(k, appName, appVersion, deviceId, deviceName, remoteEndPoint, user);});@@ -571,7 +571,7 @@ namespace Emby.Server.Implementations.Session/// </summary>/// <param name="info">The info.</param>/// <returns>Task.</returns>- /// <exception cref="System.ArgumentNullException">info</exception>+ /// <exception cref="ArgumentNullException">info</exception>public async Task OnPlaybackStart(PlaybackStartInfo info){CheckDisposed();@@ -784,8 +784,8 @@ namespace Emby.Server.Implementations.Session/// </summary>/// <param name="info">The info.</param>/// <returns>Task.</returns>- /// <exception cref="System.ArgumentNullException">info</exception>- /// <exception cref="System.ArgumentOutOfRangeException">positionTicks</exception>+ /// <exception cref="ArgumentNullException">info</exception>+ /// <exception cref="ArgumentOutOfRangeException">positionTicks</exception>public async Task OnPlaybackStopped(PlaybackStopInfo info){CheckDisposed();@@ -1284,8 +1284,8 @@ namespace Emby.Server.Implementations.Session/// </summary>/// <param name="sessionId">The session identifier.</param>/// <param name="userId">The user identifier.</param>- /// <exception cref="System.UnauthorizedAccessException">Cannot modify additional users without authenticating first.</exception>- /// <exception cref="System.ArgumentException">The requested user is already the primary user of the session.</exception>+ /// <exception cref="UnauthorizedAccessException">Cannot modify additional users without authenticating first.</exception>+ /// <exception cref="ArgumentException">The requested user is already the primary user of the session.</exception>public void AddAdditionalUser(string sessionId, Guid userId){CheckDisposed();@@ -1318,8 +1318,8 @@ namespace Emby.Server.Implementations.Session/// </summary>/// <param name="sessionId">The session identifier.</param>/// <param name="userId">The user identifier.</param>- /// <exception cref="System.UnauthorizedAccessException">Cannot modify additional users without authenticating first.</exception>- /// <exception cref="System.ArgumentException">The requested user is already the primary user of the session.</exception>+ /// <exception cref="UnauthorizedAccessException">Cannot modify additional users without authenticating first.</exception>+ /// <exception cref="ArgumentException">The requested user is already the primary user of the session.</exception>public void RemoveAdditionalUser(string sessionId, Guid userId){CheckDisposed();diff --git a/Emby.Server.Implementations/Sorting/AlphanumComparator.cs b/Emby.Server.Implementations/Sorting/AlphanumComparator.csindex f21f905df7..2e00c24d75 100644--- a/Emby.Server.Implementations/Sorting/AlphanumComparator.cs+++ b/Emby.Server.Implementations/Sorting/AlphanumComparator.cs@@ -29,8 +29,8 @@ namespace Emby.Server.Implementations.Sortingchar thisCh = s1[thisMarker];char thatCh = s2[thatMarker];- StringBuilder thisChunk = new StringBuilder();- StringBuilder thatChunk = new StringBuilder();+ var thisChunk = new StringBuilder();+ var thatChunk = new StringBuilder();while ((thisMarker < s1.Length) && (thisChunk.Length == 0 || SortHelper.InChunk(thisCh, thisChunk[0]))){diff --git a/Emby.Server.Implementations/TV/TVSeriesManager.cs b/Emby.Server.Implementations/TV/TVSeriesManager.csindex 3a9d99aa16..630ef4893b 100644--- a/Emby.Server.Implementations/TV/TVSeriesManager.cs+++ b/Emby.Server.Implementations/TV/TVSeriesManager.cs@@ -118,7 +118,7 @@ namespace Emby.Server.Implementations.TVOrderBy = new[] { new ValueTuple<string, SortOrder>(ItemSortBy.DatePlayed, SortOrder.Descending) },SeriesPresentationUniqueKey = presentationUniqueKey,Limit = limit,- DtoOptions = new MediaBrowser.Controller.Dto.DtoOptions+ DtoOptions = new DtoOptions{Fields = new ItemFields[]{@@ -196,7 +196,7 @@ namespace Emby.Server.Implementations.TVIsPlayed = true,Limit = 1,ParentIndexNumberNotEquals = 0,- DtoOptions = new MediaBrowser.Controller.Dto.DtoOptions+ DtoOptions = new DtoOptions{Fields = new ItemFields[]{diff --git a/Emby.Server.Implementations/TextEncoding/NLangDetect/Detector.cs b/Emby.Server.Implementations/TextEncoding/NLangDetect/Detector.csindex 507dd5e42d..097c7b8b75 100644--- a/Emby.Server.Implementations/TextEncoding/NLangDetect/Detector.cs+++ b/Emby.Server.Implementations/TextEncoding/NLangDetect/Detector.cs@@ -164,7 +164,7 @@ namespace NLangDetect.Corepublic string Detect(){- List<Language> probabilities = GetProbabilities();+ var probabilities = GetProbabilities();returnprobabilities.Count > 0@@ -179,7 +179,7 @@ namespace NLangDetect.CoreDetectBlock();}- List<Language> list = SortProbability(_langprob);+ var list = SortProbability(_langprob);return list;}@@ -241,7 +241,7 @@ namespace NLangDetect.Core{CleanText();- List<string> ngrams = ExtractNGrams();+ var ngrams = ExtractNGrams();if (ngrams.Count == 0){@@ -250,7 +250,7 @@ namespace NLangDetect.Core_langprob = new double[_langlist.Count];- Random rand = (_seed.HasValue ? new Random(_seed.Value) : new Random());+ var rand = (_seed.HasValue ? new Random(_seed.Value) : new Random());for (int t = 0; t < _trialsCount; t++){@@ -305,7 +305,7 @@ namespace NLangDetect.Coreprivate List<string> ExtractNGrams(){var list = new List<string>();- NGram ngram = new NGram();+ var ngram = new NGram();for (int i = 0; i < _text.Length; i++){@@ -332,7 +332,7 @@ namespace NLangDetect.Corereturn;}- ProbVector langProbMap = _wordLangProbMap[word];+ var langProbMap = _wordLangProbMap[word];double weight = alpha / _BaseFreq;for (int i = 0; i < prob.Length; i++)diff --git a/Emby.Server.Implementations/TextEncoding/NLangDetect/DetectorFactory.cs b/Emby.Server.Implementations/TextEncoding/NLangDetect/DetectorFactory.csindex c80757e682..08e98d62ec 100644--- a/Emby.Server.Implementations/TextEncoding/NLangDetect/DetectorFactory.cs+++ b/Emby.Server.Implementations/TextEncoding/NLangDetect/DetectorFactory.cs@@ -54,7 +54,7 @@ namespace NLangDetect.Corepublic static Detector Create(double alpha){- Detector detector = CreateDetector();+ var detector = CreateDetector();detector.SetAlpha(alpha);diff --git a/Emby.Server.Implementations/TextEncoding/NLangDetect/GenProfile.cs b/Emby.Server.Implementations/TextEncoding/NLangDetect/GenProfile.csindex c2b007c052..26157483b6 100644--- a/Emby.Server.Implementations/TextEncoding/NLangDetect/GenProfile.cs+++ b/Emby.Server.Implementations/TextEncoding/NLangDetect/GenProfile.cs@@ -13,8 +13,8 @@ namespace NLangDetect.Corepublic static LangProfile load(string lang, string file){- LangProfile profile = new LangProfile(lang);- TagExtractor tagextractor = new TagExtractor("abstract", 100);+ var profile = new LangProfile(lang);+ var tagextractor = new TagExtractor("abstract", 100);Stream inputStream = null;try@@ -28,7 +28,7 @@ namespace NLangDetect.CoreinputStream = new GZipStream(inputStream, CompressionMode.Decompress);}- using (XmlReader xmlReader = XmlReader.Create(inputStream))+ using (var xmlReader = XmlReader.Create(inputStream)){while (xmlReader.Read()){diff --git a/Emby.Server.Implementations/TextEncoding/NLangDetect/LanguageDetector.cs b/Emby.Server.Implementations/TextEncoding/NLangDetect/LanguageDetector.csindex 98c4f623c4..a26f236a81 100644--- a/Emby.Server.Implementations/TextEncoding/NLangDetect/LanguageDetector.cs+++ b/Emby.Server.Implementations/TextEncoding/NLangDetect/LanguageDetector.cs@@ -25,7 +25,7 @@ namespace NLangDetect.Core{if (string.IsNullOrEmpty(plainText)) { throw new ArgumentException("Argument can't be null nor empty.", nameof(plainText)); }- Detector detector = DetectorFactory.Create(_DefaultAlpha);+ var detector = DetectorFactory.Create(_DefaultAlpha);detector.Append(plainText);diff --git a/Emby.Server.Implementations/TextEncoding/NLangDetect/Utils/LangProfile.cs b/Emby.Server.Implementations/TextEncoding/NLangDetect/Utils/LangProfile.csindex 0413edfadc..78b44e1fcc 100644--- a/Emby.Server.Implementations/TextEncoding/NLangDetect/Utils/LangProfile.cs+++ b/Emby.Server.Implementations/TextEncoding/NLangDetect/Utils/LangProfile.cs@@ -59,8 +59,8 @@ namespace NLangDetect.Core.UtilsICollection<string> keys = freq.Keys;int roman = 0;// TODO IMM HI: move up?- Regex regex1 = new Regex("^[A-Za-z]$", RegexOptions.Compiled);- List<string> keysToRemove = new List<string>();+ var regex1 = new Regex("^[A-Za-z]$", RegexOptions.Compiled);+ var keysToRemove = new List<string>();foreach (string key in keys){@@ -93,7 +93,7 @@ namespace NLangDetect.Core.UtilsICollection<string> keys2 = freq.Keys;// TODO IMM HI: move up?- Regex regex2 = new Regex(".*[A-Za-z].*", RegexOptions.Compiled);+ var regex2 = new Regex(".*[A-Za-z].*", RegexOptions.Compiled);foreach (string key in keys2){diff --git a/Emby.Server.Implementations/TextEncoding/NLangDetect/Utils/Messages.cs b/Emby.Server.Implementations/TextEncoding/NLangDetect/Utils/Messages.csindex 058f350b2c..d7dab85281 100644--- a/Emby.Server.Implementations/TextEncoding/NLangDetect/Utils/Messages.cs+++ b/Emby.Server.Implementations/TextEncoding/NLangDetect/Utils/Messages.cs@@ -30,7 +30,7 @@ namespace NLangDetect.Core.Utils{var manifestName = typeof(Messages).Assembly.GetManifestResourceNames().FirstOrDefault(i => i.IndexOf("messages.properties", StringComparison.Ordinal) != -1);- Stream messagesStream =+ var messagesStream =typeof(Messages).Assembly.GetManifestResourceStream(manifestName);diff --git a/Emby.Server.Implementations/TextEncoding/TextEncodingDetect.cs b/Emby.Server.Implementations/TextEncoding/TextEncodingDetect.csindex 49a371efad..03ff0863f2 100644--- a/Emby.Server.Implementations/TextEncoding/TextEncodingDetect.cs+++ b/Emby.Server.Implementations/TextEncoding/TextEncodingDetect.cs@@ -150,7 +150,7 @@ namespace Emby.Server.Implementations.TextEncodingpublic CharacterEncoding DetectEncoding(byte[] buffer, int size){// First check if we have a BOM and return that if so- CharacterEncoding encoding = CheckBom(buffer, size);+ var encoding = CheckBom(buffer, size);if (encoding != CharacterEncoding.None){return encoding;diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/CharDistributionAnalyser.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/CharDistributionAnalyser.csindex 472dfdc51d..601b4906a4 100644--- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/CharDistributionAnalyser.cs+++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/CharDistributionAnalyser.cs@@ -83,7 +83,7 @@ namespace UniversalDetector.Core/// convert this encoding string to a number, here called order./// This allow multiple encoding of a language to share one frequency table/// </summary>- /// <param name="buf">A <see cref="System.Byte"/></param>+ /// <param name="buf">A <see cref="byte"/></param>/// <param name="offset"></param>/// <returns></returns>public abstract int GetOrder(byte[] buf, int offset);@@ -91,7 +91,7 @@ namespace UniversalDetector.Core/// <summary>/// Feed a character with known length/// </summary>- /// <param name="buf">A <see cref="System.Byte"/></param>+ /// <param name="buf">A <see cref="byte"/></param>/// <param name="offset">buf offset</param>public void HandleOneChar(byte[] buf, int offset, int charLen){diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/CharsetProber.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/CharsetProber.csindex 158dc89696..e61e5848d7 100644--- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/CharsetProber.cs+++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/CharsetProber.cs@@ -108,7 +108,7 @@ namespace UniversalDetector.Core{byte[] result = null;- using (MemoryStream ms = new MemoryStream(buf.Length))+ using (var ms = new MemoryStream(buf.Length)){bool meetMSB = false;@@ -156,7 +156,7 @@ namespace UniversalDetector.Core{byte[] result = null;- using (MemoryStream ms = new MemoryStream(buf.Length))+ using (var ms = new MemoryStream(buf.Length)){bool inTag = false;diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EscCharsetProber.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EscCharsetProber.csindex e8da73c1c7..b10c41c77f 100644--- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EscCharsetProber.cs+++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EscCharsetProber.cs@@ -84,7 +84,7 @@ namespace UniversalDetector.Core}else if (j != activeSM){- CodingStateMachine t = codingSM[activeSM];+ var t = codingSM[activeSM];codingSM[activeSM] = codingSM[j];codingSM[j] = t;}diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/MBCSGroupProber.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/MBCSGroupProber.csindex e7fa2d7192..b23e499c37 100644--- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/MBCSGroupProber.cs+++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/MBCSGroupProber.cs@@ -122,7 +122,7 @@ namespace UniversalDetector.Core}}- ProbingState st = ProbingState.NotMe;+ var st = ProbingState.NotMe;for (int i = 0; i < probers.Length; i++){diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SBCSGroupProber.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SBCSGroupProber.csindex 336726aab2..cdbc168915 100644--- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SBCSGroupProber.cs+++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SBCSGroupProber.cs@@ -59,7 +59,7 @@ namespace UniversalDetector.Coreprobers[7] = new SingleByteCharSetProber(new Win1253Model());probers[8] = new SingleByteCharSetProber(new Latin5BulgarianModel());probers[9] = new SingleByteCharSetProber(new Win1251BulgarianModel());- HebrewProber hebprober = new HebrewProber();+ var hebprober = new HebrewProber();probers[10] = hebprober;// Logicalprobers[11] = new SingleByteCharSetProber(new Win1255Model(), false, hebprober);@@ -75,7 +75,7 @@ namespace UniversalDetector.Corepublic override ProbingState HandleData(byte[] buf, int offset, int len){- ProbingState st = ProbingState.NotMe;+ var st = ProbingState.NotMe;//apply filter to original buffer, and we got new buffer back//depend on what script it is, we will feed them the new bufferdiff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/UniversalDetector.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/UniversalDetector.csindex 28a50ea3ea..812a9a7931 100644--- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/UniversalDetector.cs+++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/UniversalDetector.cs@@ -168,7 +168,7 @@ namespace UniversalDetector.Core}}- ProbingState st = ProbingState.NotMe;+ var st = ProbingState.NotMe;switch (inputState){diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.csindex 74d66fd416..68cb7821d6 100644--- a/Emby.Server.Implementations/Updates/InstallationManager.cs+++ b/Emby.Server.Implementations/Updates/InstallationManager.cs@@ -415,7 +415,7 @@ namespace Emby.Server.Implementations.Updates/// <param name="progress">The progress.</param>/// <param name="cancellationToken">The cancellation token.</param>/// <returns>Task.</returns>- /// <exception cref="System.ArgumentNullException">package</exception>+ /// <exception cref="ArgumentNullException">package</exception>public async Task InstallPackage(PackageVersionInfo package, bool isPlugin, IProgress<double> progress, CancellationToken cancellationToken){if (package == null)@@ -626,7 +626,7 @@ namespace Emby.Server.Implementations.Updates/// Uninstalls a plugin/// </summary>/// <param name="plugin">The plugin.</param>- /// <exception cref="System.ArgumentException"></exception>+ /// <exception cref="ArgumentException"></exception>public void UninstallPlugin(IPlugin plugin){plugin.OnUninstalling();diff --git a/Emby.XmlTv/Emby.XmlTv/Classes/XmlTvReader.cs b/Emby.XmlTv/Emby.XmlTv/Classes/XmlTvReader.csindex aa48406649..8234393c2c 100644--- a/Emby.XmlTv/Emby.XmlTv/Classes/XmlTvReader.cs+++ b/Emby.XmlTv/Emby.XmlTv/Classes/XmlTvReader.cs@@ -34,7 +34,7 @@ namespace Emby.XmlTv.Classesprivate static XmlReader CreateXmlTextReader(string path){- XmlReaderSettings settings = new XmlReaderSettings();+ var settings = new XmlReaderSettings();// https://msdn.microsoft.com/en-us/library/system.xml.xmlreadersettings.xmlresolver(v=vs.110).aspx// Looks like we don't need this anyway?diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.csindex 15a01ec3c8..62c65d32eb 100644--- a/Jellyfin.Server/Program.cs+++ b/Jellyfin.Server/Program.cs@@ -36,8 +36,8 @@ namespace Jellyfin.Serverpublic static async Task<int> Main(string[] args){- StartupOptions options = new StartupOptions(args);- Version version = Assembly.GetEntryAssembly().GetName().Version;+ var options = new StartupOptions(args);+ var version = Assembly.GetEntryAssembly().GetName().Version;if (options.ContainsOption("-v") || options.ContainsOption("--version")){@@ -45,7 +45,7 @@ namespace Jellyfin.Serverreturn 0;}- ServerApplicationPaths appPaths = createApplicationPaths(options);+ var appPaths = createApplicationPaths(options);// $JELLYFIN_LOG_DIR needs to be set for the logger configuration managerEnvironment.SetEnvironmentVariable("JELLYFIN_LOG_DIR", appPaths.LogDirectoryPath);await createLogger(appPaths);@@ -57,7 +57,7 @@ namespace Jellyfin.Server_logger.LogInformation("Jellyfin version: {Version}", version);- EnvironmentInfo environmentInfo = new EnvironmentInfo(getOperatingSystem());+ var environmentInfo = new EnvironmentInfo(getOperatingSystem());ApplicationHost.LogEnvironmentInfo(_logger, appPaths, environmentInfo);SQLitePCL.Batteries_V2.Init();@@ -173,7 +173,7 @@ namespace Jellyfin.Serverif (!File.Exists(configPath)){// For some reason the csproj name is used instead of the assembly name- using (Stream rscstr = typeof(Program).Assembly+ using (var rscstr = typeof(Program).Assembly.GetManifestResourceStream("Jellyfin.Server.Resources.Configuration.logging.json"))using (Stream fstr = File.Open(configPath, FileMode.CreateNew)){diff --git a/Jellyfin.Server/SocketSharp/RequestMono.cs b/Jellyfin.Server/SocketSharp/RequestMono.csindex 6e5a4e75a3..0e3d2ad657 100644--- a/Jellyfin.Server/SocketSharp/RequestMono.cs+++ b/Jellyfin.Server/SocketSharp/RequestMono.cs@@ -75,7 +75,7 @@ namespace Jellyfin.SocketSharp//// We use a substream, as in 2.x we will support large uploads streamed to disk,//- HttpPostedFile sub = new HttpPostedFile(e.Filename, e.ContentType, input, e.Start, e.Length);+ var sub = new HttpPostedFile(e.Filename, e.ContentType, input, e.Start, e.Length);files[e.Name] = sub;}}@@ -207,17 +207,17 @@ namespace Jellyfin.SocketSharpasync Task LoadWwwForm(WebROCollection form){- using (Stream input = InputStream)+ using (var input = InputStream){using (var ms = new MemoryStream()){await input.CopyToAsync(ms).ConfigureAwait(false);ms.Position = 0;- using (StreamReader s = new StreamReader(ms, ContentEncoding))+ using (var s = new StreamReader(ms, ContentEncoding)){- StringBuilder key = new StringBuilder();- StringBuilder value = new StringBuilder();+ var key = new StringBuilder();+ var value = new StringBuilder();int c;while ((c = s.Read()) != -1)@@ -269,7 +269,7 @@ namespace Jellyfin.SocketSharp{public override string ToString(){- StringBuilder result = new StringBuilder();+ var result = new StringBuilder();foreach (var pair in this){if (result.Length > 0)@@ -715,7 +715,7 @@ namespace Jellyfin.SocketSharpif (at_eof || ReadBoundary())return null;- Element elem = new Element();+ var elem = new Element();string header;while ((header = ReadHeaders()) != null){diff --git a/MediaBrowser.Api/Library/LibraryService.cs b/MediaBrowser.Api/Library/LibraryService.csindex 12d807a7e2..1248f7316f 100644--- a/MediaBrowser.Api/Library/LibraryService.cs+++ b/MediaBrowser.Api/Library/LibraryService.cs@@ -902,7 +902,7 @@ namespace MediaBrowser.Api.Libraryvar dtoOptions = GetDtoOptions(_authContext, request);- BaseItem parent = item.GetParent();+ var parent = item.GetParent();while (parent != null){diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.csindex cdf9c7d0b4..6d4af16e73 100644--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs@@ -751,7 +751,7 @@ namespace MediaBrowser.Api.PlaybackMediaSourceInfo mediaSource = null;if (string.IsNullOrWhiteSpace(request.LiveStreamId)){- TranscodingJob currentJob = !string.IsNullOrWhiteSpace(request.PlaySessionId) ?+ var currentJob = !string.IsNullOrWhiteSpace(request.PlaySessionId) ?ApiEntryPoint.Instance.GetTranscodingJob(request.PlaySessionId): null;diff --git a/MediaBrowser.Api/ScheduledTasks/ScheduledTaskService.cs b/MediaBrowser.Api/ScheduledTasks/ScheduledTaskService.csindex 502403cfeb..16b036912c 100644--- a/MediaBrowser.Api/ScheduledTasks/ScheduledTaskService.cs+++ b/MediaBrowser.Api/ScheduledTasks/ScheduledTaskService.cs@@ -168,7 +168,7 @@ namespace MediaBrowser.Api.ScheduledTasks/// </summary>/// <param name="request">The request.</param>/// <returns>IEnumerable{TaskInfo}.</returns>- /// <exception cref="MediaBrowser.Common.Extensions.ResourceNotFoundException">Task not found</exception>+ /// <exception cref="ResourceNotFoundException">Task not found</exception>public object Get(GetScheduledTask request){var task = TaskManager.ScheduledTasks.FirstOrDefault(i => string.Equals(i.Id, request.Id));@@ -187,7 +187,7 @@ namespace MediaBrowser.Api.ScheduledTasks/// Posts the specified request./// </summary>/// <param name="request">The request.</param>- /// <exception cref="MediaBrowser.Common.Extensions.ResourceNotFoundException">Task not found</exception>+ /// <exception cref="ResourceNotFoundException">Task not found</exception>public void Post(StartScheduledTask request){var task = TaskManager.ScheduledTasks.FirstOrDefault(i => string.Equals(i.Id, request.Id));@@ -214,7 +214,7 @@ namespace MediaBrowser.Api.ScheduledTasks/// Posts the specified request./// </summary>/// <param name="request">The request.</param>- /// <exception cref="MediaBrowser.Common.Extensions.ResourceNotFoundException">Task not found</exception>+ /// <exception cref="ResourceNotFoundException">Task not found</exception>public void Delete(StopScheduledTask request){var task = TaskManager.ScheduledTasks.FirstOrDefault(i => string.Equals(i.Id, request.Id));@@ -231,7 +231,7 @@ namespace MediaBrowser.Api.ScheduledTasks/// Posts the specified request./// </summary>/// <param name="request">The request.</param>- /// <exception cref="MediaBrowser.Common.Extensions.ResourceNotFoundException">Task not found</exception>+ /// <exception cref="ResourceNotFoundException">Task not found</exception>public void Post(UpdateScheduledTaskTriggers request){// We need to parse this manually because we told service stack not to with IRequiresRequestStreamdiff --git a/MediaBrowser.Api/SimilarItemsHelper.cs b/MediaBrowser.Api/SimilarItemsHelper.csindex 20a6969df0..44bb24ef2d 100644--- a/MediaBrowser.Api/SimilarItemsHelper.cs+++ b/MediaBrowser.Api/SimilarItemsHelper.cs@@ -95,7 +95,7 @@ namespace MediaBrowser.Apivar items = GetSimilaritems(item, libraryManager, inputItems, getSimilarityScore).ToList();- List<BaseItem> returnItems = items;+ var returnItems = items;if (request.Limit.HasValue){diff --git a/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs b/MediaBrowser.Api/UserLibrary/BaseItemsRequest.csindex 3daa5779cc..4cccc0cb5a 100644--- a/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs+++ b/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs@@ -459,7 +459,7 @@ namespace MediaBrowser.Api.UserLibraryif (string.IsNullOrEmpty(val)){- return Array.Empty<ValueTuple<string, Model.Entities.SortOrder>>();+ return Array.Empty<ValueTuple<string, SortOrder>>();}var vals = val.Split(',');@@ -470,7 +470,7 @@ namespace MediaBrowser.Api.UserLibraryvar sortOrders = requestedSortOrder.Split(',');- var result = new ValueTuple<string, Model.Entities.SortOrder>[vals.Length];+ var result = new ValueTuple<string, SortOrder>[vals.Length];for (var i = 0; i < vals.Length; i++){@@ -479,7 +479,7 @@ namespace MediaBrowser.Api.UserLibraryvar sortOrderValue = sortOrders.Length > sortOrderIndex ? sortOrders[sortOrderIndex] : null;var sortOrder = string.Equals(sortOrderValue, "Descending", StringComparison.OrdinalIgnoreCase) ? MediaBrowser.Model.Entities.SortOrder.Descending : MediaBrowser.Model.Entities.SortOrder.Ascending;- result[i] = new ValueTuple<string, Model.Entities.SortOrder>(vals[i], sortOrder);+ result[i] = new ValueTuple<string, SortOrder>(vals[i], sortOrder);}return result;diff --git a/MediaBrowser.Common/Net/IHttpClient.cs b/MediaBrowser.Common/Net/IHttpClient.csindex 5f4e3e5d1e..5aaf7e0be6 100644--- a/MediaBrowser.Common/Net/IHttpClient.cs+++ b/MediaBrowser.Common/Net/IHttpClient.cs@@ -43,7 +43,7 @@ namespace MediaBrowser.Common.Net/// <param name="options">The options.</param>/// <returns>Task{System.String}.</returns>/// <exception cref="System.ArgumentNullException">progress</exception>- /// <exception cref="MediaBrowser.Model.Net.HttpException"></exception>+ /// <exception cref="Model.Net.HttpException"></exception>Task<string> GetTempFile(HttpRequestOptions options);/// <summary>diff --git a/MediaBrowser.Common/Plugins/BasePlugin.cs b/MediaBrowser.Common/Plugins/BasePlugin.csindex a14c9fb34b..1ff2e98ef7 100644--- a/MediaBrowser.Common/Plugins/BasePlugin.cs+++ b/MediaBrowser.Common/Plugins/BasePlugin.cs@@ -212,7 +212,7 @@ namespace MediaBrowser.Common.Plugins/// Returns true or false indicating success or failure/// </summary>/// <param name="configuration">The configuration.</param>- /// <exception cref="System.ArgumentNullException">configuration</exception>+ /// <exception cref="ArgumentNullException">configuration</exception>public virtual void UpdateConfiguration(BasePluginConfiguration configuration){if (configuration == null)diff --git a/MediaBrowser.Common/Plugins/IPlugin.cs b/MediaBrowser.Common/Plugins/IPlugin.csindex 037e11ce89..32527c2997 100644--- a/MediaBrowser.Common/Plugins/IPlugin.cs+++ b/MediaBrowser.Common/Plugins/IPlugin.cs@@ -69,7 +69,7 @@ namespace MediaBrowser.Common.Plugins/// Returns true or false indicating success or failure/// </summary>/// <param name="configuration">The configuration.</param>- /// <exception cref="System.ArgumentNullException">configuration</exception>+ /// <exception cref="ArgumentNullException">configuration</exception>void UpdateConfiguration(BasePluginConfiguration configuration);/// <summary>diff --git a/MediaBrowser.Common/Updates/IInstallationManager.cs b/MediaBrowser.Common/Updates/IInstallationManager.csindex 52d5d7dcbb..8bef784009 100644--- a/MediaBrowser.Common/Updates/IInstallationManager.cs+++ b/MediaBrowser.Common/Updates/IInstallationManager.cs@@ -108,14 +108,14 @@ namespace MediaBrowser.Common.Updates/// <param name="progress">The progress.</param>/// <param name="cancellationToken">The cancellation token.</param>/// <returns>Task.</returns>- /// <exception cref="System.ArgumentNullException">package</exception>+ /// <exception cref="ArgumentNullException">package</exception>Task InstallPackage(PackageVersionInfo package, bool isPlugin, IProgress<double> progress, CancellationToken cancellationToken);/// <summary>/// Uninstalls a plugin/// </summary>/// <param name="plugin">The plugin.</param>- /// <exception cref="System.ArgumentException"></exception>+ /// <exception cref="ArgumentException"></exception>void UninstallPlugin(IPlugin plugin);}}diff --git a/MediaBrowser.Controller/Entities/AggregateFolder.cs b/MediaBrowser.Controller/Entities/AggregateFolder.csindex 522b3e33e9..054df21e52 100644--- a/MediaBrowser.Controller/Entities/AggregateFolder.cs+++ b/MediaBrowser.Controller/Entities/AggregateFolder.cs@@ -164,7 +164,7 @@ namespace MediaBrowser.Controller.Entities/// Adds the virtual child./// </summary>/// <param name="child">The child.</param>- /// <exception cref="System.ArgumentNullException"></exception>+ /// <exception cref="ArgumentNullException"></exception>public void AddVirtualChild(BaseItem child){if (child == null)@@ -180,7 +180,7 @@ namespace MediaBrowser.Controller.Entities/// </summary>/// <param name="id">The id.</param>/// <returns>BaseItem.</returns>- /// <exception cref="System.ArgumentNullException">id</exception>+ /// <exception cref="ArgumentNullException">id</exception>public BaseItem FindVirtualChild(Guid id){if (id.Equals(Guid.Empty))diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.csindex 995f394834..68374c8df9 100644--- a/MediaBrowser.Controller/Entities/BaseItem.cs+++ b/MediaBrowser.Controller/Entities/BaseItem.cs@@ -367,7 +367,7 @@ namespace MediaBrowser.Controller.Entities}char thisCh = s1[thisMarker];- StringBuilder thisChunk = new StringBuilder();+ var thisChunk = new StringBuilder();while ((thisMarker < s1.Length) && (thisChunk.Length == 0 || SortHelper.InChunk(thisCh, thisChunk[0]))){@@ -548,9 +548,9 @@ namespace MediaBrowser.Controller.Entitiespublic static IMediaSourceManager MediaSourceManager { get; set; }/// <summary>- /// Returns a <see cref="System.String" /> that represents this instance.+ /// Returns a <see cref="string" /> that represents this instance./// </summary>- /// <returns>A <see cref="System.String" /> that represents this instance.</returns>+ /// <returns>A <see cref="string" /> that represents this instance.</returns>public override string ToString(){return Name;@@ -1661,7 +1661,7 @@ namespace MediaBrowser.Controller.Entities/// </summary>/// <param name="user">The user.</param>/// <returns><c>true</c> if [is parental allowed] [the specified user]; otherwise, <c>false</c>.</returns>- /// <exception cref="System.ArgumentNullException">user</exception>+ /// <exception cref="ArgumentNullException">user</exception>public bool IsParentalAllowed(User user){if (user == null)@@ -1811,7 +1811,7 @@ namespace MediaBrowser.Controller.Entities/// </summary>/// <param name="user">The user.</param>/// <returns><c>true</c> if the specified user is visible; otherwise, <c>false</c>.</returns>- /// <exception cref="System.ArgumentNullException">user</exception>+ /// <exception cref="ArgumentNullException">user</exception>public virtual bool IsVisible(User user){if (user == null)@@ -1971,7 +1971,7 @@ namespace MediaBrowser.Controller.Entities/// Adds a studio to the item/// </summary>/// <param name="name">The name.</param>- /// <exception cref="System.ArgumentNullException"></exception>+ /// <exception cref="ArgumentNullException"></exception>public void AddStudio(string name){if (string.IsNullOrEmpty(name))@@ -2004,7 +2004,7 @@ namespace MediaBrowser.Controller.Entities/// Adds a genre to the item/// </summary>/// <param name="name">The name.</param>- /// <exception cref="System.ArgumentNullException"></exception>+ /// <exception cref="ArgumentNullException"></exception>public void AddGenre(string name){if (string.IsNullOrEmpty(name))@@ -2028,7 +2028,7 @@ namespace MediaBrowser.Controller.Entities/// <param name="datePlayed">The date played.</param>/// <param name="resetPosition">if set to <c>true</c> [reset position].</param>/// <returns>Task.</returns>- /// <exception cref="System.ArgumentNullException"></exception>+ /// <exception cref="ArgumentNullException"></exception>public virtual void MarkPlayed(User user,DateTime? datePlayed,bool resetPosition)@@ -2065,7 +2065,7 @@ namespace MediaBrowser.Controller.Entities/// </summary>/// <param name="user">The user.</param>/// <returns>Task.</returns>- /// <exception cref="System.ArgumentNullException"></exception>+ /// <exception cref="ArgumentNullException"></exception>public virtual void MarkUnplayed(User user){if (user == null)@@ -2104,7 +2104,7 @@ namespace MediaBrowser.Controller.Entities/// <param name="type">The type.</param>/// <param name="imageIndex">Index of the image.</param>/// <returns><c>true</c> if the specified type has image; otherwise, <c>false</c>.</returns>- /// <exception cref="System.ArgumentException">Backdrops should be accessed using Item.Backdrops</exception>+ /// <exception cref="ArgumentException">Backdrops should be accessed using Item.Backdrops</exception>public bool HasImage(ImageType type, int imageIndex){return GetImageInfo(type, imageIndex) != null;@@ -2232,9 +2232,9 @@ namespace MediaBrowser.Controller.Entities/// <param name="imageType">Type of the image.</param>/// <param name="imageIndex">Index of the image.</param>/// <returns>System.String.</returns>- /// <exception cref="System.InvalidOperationException">+ /// <exception cref="InvalidOperationException">/// </exception>- /// <exception cref="System.ArgumentNullException">item</exception>+ /// <exception cref="ArgumentNullException">item</exception>public string GetImagePath(ImageType imageType, int imageIndex){var info = GetImageInfo(imageType, imageIndex);@@ -2294,7 +2294,7 @@ namespace MediaBrowser.Controller.Entities/// <param name="imageType">Type of the image.</param>/// <param name="images">The images.</param>/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>- /// <exception cref="System.ArgumentException">Cannot call AddImages with chapter images</exception>+ /// <exception cref="ArgumentException">Cannot call AddImages with chapter images</exception>public bool AddImages(ImageType imageType, List<FileSystemMetadata> images){if (imageType == ImageType.Chapter)diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.csindex fe53d2f051..bbee594f6a 100644--- a/MediaBrowser.Controller/Entities/Folder.cs+++ b/MediaBrowser.Controller/Entities/Folder.cs@@ -135,7 +135,7 @@ namespace MediaBrowser.Controller.Entities/// <param name="item">The item.</param>/// <param name="cancellationToken">The cancellation token.</param>/// <returns>Task.</returns>- /// <exception cref="System.InvalidOperationException">Unable to add + item.Name</exception>+ /// <exception cref="InvalidOperationException">Unable to add + item.Name</exception>public void AddChild(BaseItem item, CancellationToken cancellationToken){item.SetParent(this);@@ -1261,7 +1261,7 @@ namespace MediaBrowser.Controller.Entities/// <param name="user">The user.</param>/// <param name="includeLinkedChildren">if set to <c>true</c> [include linked children].</param>/// <returns>IEnumerable{BaseItem}.</returns>- /// <exception cref="System.ArgumentNullException"></exception>+ /// <exception cref="ArgumentNullException"></exception>public IEnumerable<BaseItem> GetRecursiveChildren(User user, bool includeLinkedChildren = true){return GetRecursiveChildren(user, null);diff --git a/MediaBrowser.Controller/Entities/Person.cs b/MediaBrowser.Controller/Entities/Person.csindex 0ba8b3b48f..dd01834898 100644--- a/MediaBrowser.Controller/Entities/Person.cs+++ b/MediaBrowser.Controller/Entities/Person.cs@@ -175,9 +175,9 @@ namespace MediaBrowser.Controller.Entitiespublic Dictionary<string, string> ProviderIds { get; set; }/// <summary>- /// Returns a <see cref="System.String" /> that represents this instance.+ /// Returns a <see cref="string" /> that represents this instance./// </summary>- /// <returns>A <see cref="System.String" /> that represents this instance.</returns>+ /// <returns>A <see cref="string" /> that represents this instance.</returns>public override string ToString(){return Name;diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.csindex 5ba4613c06..4539ab0f26 100644--- a/MediaBrowser.Controller/Entities/TV/Series.cs+++ b/MediaBrowser.Controller/Entities/TV/Series.cs@@ -119,7 +119,7 @@ namespace MediaBrowser.Controller.Entities.TVIncludeItemTypes = new[] { typeof(Season).Name },IsVirtualItem = false,Limit = 0,- DtoOptions = new Dto.DtoOptions(false)+ DtoOptions = new DtoOptions(false){EnableImages = false}@@ -136,7 +136,7 @@ namespace MediaBrowser.Controller.Entities.TV{AncestorWithPresentationUniqueKey = null,SeriesPresentationUniqueKey = seriesKey,- DtoOptions = new Dto.DtoOptions(false)+ DtoOptions = new DtoOptions(false){EnableImages = false}diff --git a/MediaBrowser.Controller/Entities/User.cs b/MediaBrowser.Controller/Entities/User.csindex 16fef9a824..10fe096a46 100644--- a/MediaBrowser.Controller/Entities/User.cs+++ b/MediaBrowser.Controller/Entities/User.cs@@ -149,7 +149,7 @@ namespace MediaBrowser.Controller.Entities/// </summary>/// <param name="newName">The new name.</param>/// <returns>Task.</returns>- /// <exception cref="System.ArgumentNullException"></exception>+ /// <exception cref="ArgumentNullException"></exception>public Task Rename(string newName){if (string.IsNullOrEmpty(newName))diff --git a/MediaBrowser.Controller/Entities/UserItemData.cs b/MediaBrowser.Controller/Entities/UserItemData.csindex 8a87aff5f5..f7136bdf2e 100644--- a/MediaBrowser.Controller/Entities/UserItemData.cs+++ b/MediaBrowser.Controller/Entities/UserItemData.cs@@ -28,7 +28,7 @@ namespace MediaBrowser.Controller.Entities/// Gets or sets the users 0-10 rating/// </summary>/// <value>The rating.</value>- /// <exception cref="System.ArgumentOutOfRangeException">Rating;A 0 to 10 rating is required for UserItemData.</exception>+ /// <exception cref="ArgumentOutOfRangeException">Rating;A 0 to 10 rating is required for UserItemData.</exception>public double? Rating{get => _rating;diff --git a/MediaBrowser.Controller/IO/FileData.cs b/MediaBrowser.Controller/IO/FileData.csindex e7c27d8464..4bbb60283e 100644--- a/MediaBrowser.Controller/IO/FileData.cs+++ b/MediaBrowser.Controller/IO/FileData.cs@@ -34,7 +34,7 @@ namespace MediaBrowser.Controller.IO/// <param name="flattenFolderDepth">The flatten folder depth.</param>/// <param name="resolveShortcuts">if set to <c>true</c> [resolve shortcuts].</param>/// <returns>Dictionary{System.StringFileSystemInfo}.</returns>- /// <exception cref="System.ArgumentNullException">path</exception>+ /// <exception cref="ArgumentNullException">path</exception>public static FileSystemMetadata[] GetFilteredFileSystemEntries(IDirectoryService directoryService,string path,IFileSystem fileSystem,diff --git a/MediaBrowser.Controller/Library/ILibraryManager.cs b/MediaBrowser.Controller/Library/ILibraryManager.csindex 0ada91b2e9..9d404ba1a6 100644--- a/MediaBrowser.Controller/Library/ILibraryManager.cs+++ b/MediaBrowser.Controller/Library/ILibraryManager.cs@@ -100,7 +100,7 @@ namespace MediaBrowser.Controller.Library/// </summary>/// <param name="value">The value.</param>/// <returns>Task{Year}.</returns>- /// <exception cref="System.ArgumentOutOfRangeException"></exception>+ /// <exception cref="ArgumentOutOfRangeException"></exception>Year GetYear(int value);/// <summary>diff --git a/MediaBrowser.Controller/Library/IUserManager.cs b/MediaBrowser.Controller/Library/IUserManager.csindex bf60aa25ad..925d91a375 100644--- a/MediaBrowser.Controller/Library/IUserManager.cs+++ b/MediaBrowser.Controller/Library/IUserManager.cs@@ -43,7 +43,7 @@ namespace MediaBrowser.Controller.Library/// </summary>/// <param name="id">The id.</param>/// <returns>User.</returns>- /// <exception cref="System.ArgumentNullException"></exception>+ /// <exception cref="ArgumentNullException"></exception>User GetUserById(Guid id);/// <summary>@@ -73,16 +73,16 @@ namespace MediaBrowser.Controller.Library/// <param name="user">The user.</param>/// <param name="newName">The new name.</param>/// <returns>Task.</returns>- /// <exception cref="System.ArgumentNullException">user</exception>- /// <exception cref="System.ArgumentException"></exception>+ /// <exception cref="ArgumentNullException">user</exception>+ /// <exception cref="ArgumentException"></exception>Task RenameUser(User user, string newName);/// <summary>/// Updates the user./// </summary>/// <param name="user">The user.</param>- /// <exception cref="System.ArgumentNullException">user</exception>- /// <exception cref="System.ArgumentException"></exception>+ /// <exception cref="ArgumentNullException">user</exception>+ /// <exception cref="ArgumentException"></exception>void UpdateUser(User user);/// <summary>@@ -90,8 +90,8 @@ namespace MediaBrowser.Controller.Library/// </summary>/// <param name="name">The name.</param>/// <returns>User.</returns>- /// <exception cref="System.ArgumentNullException">name</exception>- /// <exception cref="System.ArgumentException"></exception>+ /// <exception cref="ArgumentNullException">name</exception>+ /// <exception cref="ArgumentException"></exception>Task<User> CreateUser(string name);/// <summary>@@ -99,8 +99,8 @@ namespace MediaBrowser.Controller.Library/// </summary>/// <param name="user">The user.</param>/// <returns>Task.</returns>- /// <exception cref="System.ArgumentNullException">user</exception>- /// <exception cref="System.ArgumentException"></exception>+ /// <exception cref="ArgumentNullException">user</exception>+ /// <exception cref="ArgumentException"></exception>Task DeleteUser(User user);/// <summary>diff --git a/MediaBrowser.Controller/Library/ItemResolveArgs.cs b/MediaBrowser.Controller/Library/ItemResolveArgs.csindex eb459e8904..7bb8325f8c 100644--- a/MediaBrowser.Controller/Library/ItemResolveArgs.cs+++ b/MediaBrowser.Controller/Library/ItemResolveArgs.cs@@ -138,7 +138,7 @@ namespace MediaBrowser.Controller.Library/// Adds the additional location./// </summary>/// <param name="path">The path.</param>- /// <exception cref="System.ArgumentNullException"></exception>+ /// <exception cref="ArgumentNullException"></exception>public void AddAdditionalLocation(string path){if (string.IsNullOrEmpty(path))@@ -173,7 +173,7 @@ namespace MediaBrowser.Controller.Library/// </summary>/// <param name="name">The name.</param>/// <returns>FileSystemInfo.</returns>- /// <exception cref="System.ArgumentNullException"></exception>+ /// <exception cref="ArgumentNullException"></exception>public FileSystemMetadata GetFileSystemEntryByName(string name){if (string.IsNullOrEmpty(name))@@ -189,7 +189,7 @@ namespace MediaBrowser.Controller.Library/// </summary>/// <param name="path">The path.</param>/// <returns>FileSystemInfo.</returns>- /// <exception cref="System.ArgumentNullException"></exception>+ /// <exception cref="ArgumentNullException"></exception>public FileSystemMetadata GetFileSystemEntryByPath(string path){if (string.IsNullOrEmpty(path))@@ -228,10 +228,10 @@ namespace MediaBrowser.Controller.Library#region Equality Overrides/// <summary>- /// Determines whether the specified <see cref="System.Object" /> is equal to this instance.+ /// Determines whether the specified <see cref="object" /> is equal to this instance./// </summary>/// <param name="obj">The object to compare with the current object.</param>- /// <returns><c>true</c> if the specified <see cref="System.Object" /> is equal to this instance; otherwise, <c>false</c>.</returns>+ /// <returns><c>true</c> if the specified <see cref="object" /> is equal to this instance; otherwise, <c>false</c>.</returns>public override bool Equals(object obj){return Equals(obj as ItemResolveArgs);diff --git a/MediaBrowser.Controller/Net/IWebSocketConnection.cs b/MediaBrowser.Controller/Net/IWebSocketConnection.csindex 6d31c6dbb6..a09b2f7a22 100644--- a/MediaBrowser.Controller/Net/IWebSocketConnection.cs+++ b/MediaBrowser.Controller/Net/IWebSocketConnection.cs@@ -62,7 +62,7 @@ namespace MediaBrowser.Controller.Net/// <param name="message">The message.</param>/// <param name="cancellationToken">The cancellation token.</param>/// <returns>Task.</returns>- /// <exception cref="System.ArgumentNullException">message</exception>+ /// <exception cref="ArgumentNullException">message</exception>Task SendAsync<T>(WebSocketMessage<T> message, CancellationToken cancellationToken);/// <summary>@@ -79,7 +79,7 @@ namespace MediaBrowser.Controller.Net/// <param name="text">The text.</param>/// <param name="cancellationToken">The cancellation token.</param>/// <returns>Task.</returns>- /// <exception cref="System.ArgumentNullException">buffer</exception>+ /// <exception cref="ArgumentNullException">buffer</exception>Task SendAsync(string text, CancellationToken cancellationToken);}}diff --git a/MediaBrowser.Controller/Session/ISessionManager.cs b/MediaBrowser.Controller/Session/ISessionManager.csindex 6a4f0aa083..771027103b 100644--- a/MediaBrowser.Controller/Session/ISessionManager.cs+++ b/MediaBrowser.Controller/Session/ISessionManager.cs@@ -90,7 +90,7 @@ namespace MediaBrowser.Controller.Session/// </summary>/// <param name="info">The info.</param>/// <returns>Task.</returns>- /// <exception cref="System.ArgumentNullException"></exception>+ /// <exception cref="ArgumentNullException"></exception>Task OnPlaybackProgress(PlaybackProgressInfo info);Task OnPlaybackProgress(PlaybackProgressInfo info, bool isAutomated);@@ -100,7 +100,7 @@ namespace MediaBrowser.Controller.Session/// </summary>/// <param name="info">The info.</param>/// <returns>Task.</returns>- /// <exception cref="System.ArgumentNullException"></exception>+ /// <exception cref="ArgumentNullException"></exception>Task OnPlaybackStopped(PlaybackStopInfo info);/// <summary>diff --git a/MediaBrowser.Controller/Sorting/SortExtensions.cs b/MediaBrowser.Controller/Sorting/SortExtensions.csindex 56d9c1a64c..111f4f17fc 100644--- a/MediaBrowser.Controller/Sorting/SortExtensions.cs+++ b/MediaBrowser.Controller/Sorting/SortExtensions.cs@@ -72,8 +72,8 @@ namespace MediaBrowser.Controller.Sortingchar thisCh = s1[thisMarker];char thatCh = s2[thatMarker];- StringBuilder thisChunk = new StringBuilder();- StringBuilder thatChunk = new StringBuilder();+ var thisChunk = new StringBuilder();+ var thatChunk = new StringBuilder();while ((thisMarker < s1.Length) && (thisChunk.Length == 0 || InChunk(thisCh, thisChunk[0]))){diff --git a/MediaBrowser.LocalMetadata/Images/LocalImageProvider.cs b/MediaBrowser.LocalMetadata/Images/LocalImageProvider.csindex 0a4928ed7f..e4efa2c351 100644--- a/MediaBrowser.LocalMetadata/Images/LocalImageProvider.cs+++ b/MediaBrowser.LocalMetadata/Images/LocalImageProvider.cs@@ -96,7 +96,7 @@ namespace MediaBrowser.LocalMetadata.Imagespublic List<LocalImageInfo> GetImages(BaseItem item, IEnumerable<string> paths, bool arePathsInMediaFolders, IDirectoryService directoryService){- IEnumerable<FileSystemMetadata> files = paths.SelectMany(i => _fileSystem.GetFiles(i, BaseItem.SupportedImageExtensions, true, false));+ var files = paths.SelectMany(i => _fileSystem.GetFiles(i, BaseItem.SupportedImageExtensions, true, false));files = files.OrderBy(i => Array.IndexOf(BaseItem.SupportedImageExtensions, i.Extension ?? string.Empty));diff --git a/MediaBrowser.LocalMetadata/Parsers/BaseItemXmlParser.cs b/MediaBrowser.LocalMetadata/Parsers/BaseItemXmlParser.csindex fef673bfd2..0ee283325b 100644--- a/MediaBrowser.LocalMetadata/Parsers/BaseItemXmlParser.cs+++ b/MediaBrowser.LocalMetadata/Parsers/BaseItemXmlParser.cs@@ -51,7 +51,7 @@ namespace MediaBrowser.LocalMetadata.Parsers/// <param name="item">The item.</param>/// <param name="metadataFile">The metadata file.</param>/// <param name="cancellationToken">The cancellation token.</param>- /// <exception cref="System.ArgumentNullException"></exception>+ /// <exception cref="ArgumentNullException"></exception>public void Fetch(MetadataResult<T> item, string metadataFile, CancellationToken cancellationToken){if (item == null)@@ -102,7 +102,7 @@ namespace MediaBrowser.LocalMetadata.Parsers{item.ResetPeople();- using (Stream fileStream = FileSystem.OpenRead(metadataFile))+ using (var fileStream = FileSystem.OpenRead(metadataFile)){using (var streamReader = new StreamReader(fileStream, encoding)){@@ -263,7 +263,7 @@ namespace MediaBrowser.LocalMetadata.Parsers{MetadataFields field;- if (Enum.TryParse<MetadataFields>(i, true, out field))+ if (Enum.TryParse(i, true, out field)){return (MetadataFields?)field;}@@ -384,7 +384,7 @@ namespace MediaBrowser.LocalMetadata.Parserscase "Director":{- foreach (var p in SplitNames(reader.ReadElementContentAsString()).Select(v => new Controller.Entities.PersonInfo { Name = v.Trim(), Type = PersonType.Director }))+ foreach (var p in SplitNames(reader.ReadElementContentAsString()).Select(v => new PersonInfo { Name = v.Trim(), Type = PersonType.Director })){if (string.IsNullOrWhiteSpace(p.Name)){@@ -396,7 +396,7 @@ namespace MediaBrowser.LocalMetadata.Parsers}case "Writer":{- foreach (var p in SplitNames(reader.ReadElementContentAsString()).Select(v => new Controller.Entities.PersonInfo { Name = v.Trim(), Type = PersonType.Writer }))+ foreach (var p in SplitNames(reader.ReadElementContentAsString()).Select(v => new PersonInfo { Name = v.Trim(), Type = PersonType.Writer })){if (string.IsNullOrWhiteSpace(p.Name)){@@ -421,7 +421,7 @@ namespace MediaBrowser.LocalMetadata.Parserselse{// Old-style piped string- foreach (var p in SplitNames(actors).Select(v => new Controller.Entities.PersonInfo { Name = v.Trim(), Type = PersonType.Actor }))+ foreach (var p in SplitNames(actors).Select(v => new PersonInfo { Name = v.Trim(), Type = PersonType.Actor })){if (string.IsNullOrWhiteSpace(p.Name)){@@ -435,7 +435,7 @@ namespace MediaBrowser.LocalMetadata.Parserscase "GuestStars":{- foreach (var p in SplitNames(reader.ReadElementContentAsString()).Select(v => new Controller.Entities.PersonInfo { Name = v.Trim(), Type = PersonType.GuestStar }))+ foreach (var p in SplitNames(reader.ReadElementContentAsString()).Select(v => new PersonInfo { Name = v.Trim(), Type = PersonType.GuestStar })){if (string.IsNullOrWhiteSpace(p.Name)){diff --git a/MediaBrowser.LocalMetadata/Savers/BaseXmlSaver.cs b/MediaBrowser.LocalMetadata/Savers/BaseXmlSaver.csindex 2ddf922f96..2eac35f282 100644--- a/MediaBrowser.LocalMetadata/Savers/BaseXmlSaver.cs+++ b/MediaBrowser.LocalMetadata/Savers/BaseXmlSaver.cs@@ -130,7 +130,7 @@ namespace MediaBrowser.LocalMetadata.SaversCloseOutput = false};- using (XmlWriter writer = XmlWriter.Create(stream, settings))+ using (var writer = XmlWriter.Create(stream, settings)){var root = GetRootElementName(item);diff --git a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.csindex 262772959a..c0578aad1c 100644--- a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs+++ b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs@@ -152,7 +152,7 @@ namespace MediaBrowser.MediaEncoding.Encoderprivate string GetProcessOutput(string path, string arguments){- IProcess process = _processFactory.Create(new ProcessOptions+ var process = _processFactory.Create(new ProcessOptions{CreateNoWindow = true,UseShellExecute = false,diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.csindex 8489cc9b17..63642b571e 100644--- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs+++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs@@ -457,7 +457,7 @@ namespace MediaBrowser.MediaEncoding.Encoder/// <param name="inputFiles">The input files.</param>/// <param name="protocol">The protocol.</param>/// <returns>System.String.</returns>- /// <exception cref="System.ArgumentException">Unrecognized InputType</exception>+ /// <exception cref="ArgumentException">Unrecognized InputType</exception>public string GetInputArgument(string[] inputFiles, MediaProtocol protocol){return EncodingUtils.GetInputArgument(inputFiles.ToList(), protocol);diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.csindex 51d2bcba7e..7b89647071 100644--- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs+++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs@@ -300,7 +300,7 @@ namespace MediaBrowser.MediaEncoding.Probingprivate void ReadFromDictNode(XmlReader reader, MediaInfo info){string currentKey = null;- List<NameValuePair> pairs = new List<NameValuePair>();+ var pairs = new List<NameValuePair>();reader.MoveToContent();reader.Read();@@ -360,7 +360,7 @@ namespace MediaBrowser.MediaEncoding.Probingprivate List<NameValuePair> ReadValueArray(XmlReader reader){- List<NameValuePair> pairs = new List<NameValuePair>();+ var pairs = new List<NameValuePair>();reader.MoveToContent();reader.Read();@@ -881,7 +881,7 @@ namespace MediaBrowser.MediaEncoding.Probing}}- private void SetSize(InternalMediaInfoResult data, Model.MediaInfo.MediaInfo info)+ private void SetSize(InternalMediaInfoResult data, MediaInfo info){if (data.format != null){@@ -901,7 +901,7 @@ namespace MediaBrowser.MediaEncoding.Probingvar composer = FFProbeHelpers.GetDictionaryValue(tags, "composer");if (!string.IsNullOrWhiteSpace(composer)){- List<BaseItemPerson> peoples = new List<BaseItemPerson>();+ var peoples = new List<BaseItemPerson>();foreach (var person in Split(composer, false)){peoples.Add(new BaseItemPerson { Name = person, Type = PersonType.Composer });@@ -932,7 +932,7 @@ namespace MediaBrowser.MediaEncoding.Probingif (!string.IsNullOrWhiteSpace(writer)){- List<BaseItemPerson> peoples = new List<BaseItemPerson>();+ var peoples = new List<BaseItemPerson>();foreach (var person in Split(writer, false)){peoples.Add(new BaseItemPerson { Name = person, Type = PersonType.Writer });@@ -1125,7 +1125,7 @@ namespace MediaBrowser.MediaEncoding.Probingif (!string.IsNullOrEmpty(val)){var studios = Split(val, true);- List<string> studioList = new List<string>();+ var studioList = new List<string>();foreach (var studio in studios){@@ -1160,7 +1160,7 @@ namespace MediaBrowser.MediaEncoding.Probingif (!string.IsNullOrEmpty(val)){- List<string> genres = new List<string>(info.Genres);+ var genres = new List<string>(info.Genres);foreach (var genre in Split(val, true)){genres.Add(genre);diff --git a/MediaBrowser.MediaEncoding/Subtitles/AssParser.cs b/MediaBrowser.MediaEncoding/Subtitles/AssParser.csindex 0aa6a3e443..7f312eaecb 100644--- a/MediaBrowser.MediaEncoding/Subtitles/AssParser.cs+++ b/MediaBrowser.MediaEncoding/Subtitles/AssParser.cs@@ -17,7 +17,7 @@ namespace MediaBrowser.MediaEncoding.Subtitlespublic SubtitleTrackInfo Parse(Stream stream, CancellationToken cancellationToken){var trackInfo = new SubtitleTrackInfo();- List<SubtitleTrackEvent> trackEvents = new List<SubtitleTrackEvent>();+ var trackEvents = new List<SubtitleTrackEvent>();var eventIndex = 1;using (var reader = new StreamReader(stream)){diff --git a/MediaBrowser.MediaEncoding/Subtitles/SrtParser.cs b/MediaBrowser.MediaEncoding/Subtitles/SrtParser.csindex c3f6d49475..02ce71ec38 100644--- a/MediaBrowser.MediaEncoding/Subtitles/SrtParser.cs+++ b/MediaBrowser.MediaEncoding/Subtitles/SrtParser.cs@@ -24,7 +24,7 @@ namespace MediaBrowser.MediaEncoding.Subtitlespublic SubtitleTrackInfo Parse(Stream stream, CancellationToken cancellationToken){var trackInfo = new SubtitleTrackInfo();- List<SubtitleTrackEvent> trackEvents = new List<SubtitleTrackEvent>();+ var trackEvents = new List<SubtitleTrackEvent>();using (var reader = new StreamReader(stream)){string line;diff --git a/MediaBrowser.MediaEncoding/Subtitles/SsaParser.cs b/MediaBrowser.MediaEncoding/Subtitles/SsaParser.csindex 1cd714f327..8281de7643 100644--- a/MediaBrowser.MediaEncoding/Subtitles/SsaParser.cs+++ b/MediaBrowser.MediaEncoding/Subtitles/SsaParser.cs@@ -16,7 +16,7 @@ namespace MediaBrowser.MediaEncoding.Subtitlespublic SubtitleTrackInfo Parse(Stream stream, CancellationToken cancellationToken){var trackInfo = new SubtitleTrackInfo();- List<SubtitleTrackEvent> trackEvents = new List<SubtitleTrackEvent>();+ var trackEvents = new List<SubtitleTrackEvent>();using (var reader = new StreamReader(stream)){diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.csindex 3b75146136..4f424d39bd 100644--- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs+++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs@@ -408,7 +408,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles/// <param name="outputPath">The output path.</param>/// <param name="cancellationToken">The cancellation token.</param>/// <returns>Task.</returns>- /// <exception cref="System.ArgumentNullException">+ /// <exception cref="ArgumentNullException">/// inputPath/// or/// outputPath@@ -525,7 +525,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles/// <param name="outputPath">The output path.</param>/// <param name="cancellationToken">The cancellation token.</param>/// <returns>Task.</returns>- /// <exception cref="System.ArgumentException">Must use inputPath list overload</exception>+ /// <exception cref="ArgumentException">Must use inputPath list overload</exception>private async Task ExtractTextSubtitle(string[] inputFiles,MediaProtocol protocol,@@ -734,7 +734,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles{if (protocol == MediaProtocol.Http){- HttpRequestOptions opts = new HttpRequestOptions()+ var opts = new HttpRequestOptions(){Url = path,CancellationToken = cancellationTokendiff --git a/MediaBrowser.MediaEncoding/Subtitles/VttWriter.cs b/MediaBrowser.MediaEncoding/Subtitles/VttWriter.csindex d67d1dad84..2e328ba63e 100644--- a/MediaBrowser.MediaEncoding/Subtitles/VttWriter.cs+++ b/MediaBrowser.MediaEncoding/Subtitles/VttWriter.cs@@ -19,8 +19,8 @@ namespace MediaBrowser.MediaEncoding.Subtitles{cancellationToken.ThrowIfCancellationRequested();- TimeSpan startTime = TimeSpan.FromTicks(trackEvent.StartPositionTicks);- TimeSpan endTime = TimeSpan.FromTicks(trackEvent.EndPositionTicks);+ var startTime = TimeSpan.FromTicks(trackEvent.StartPositionTicks);+ var endTime = TimeSpan.FromTicks(trackEvent.EndPositionTicks);// make sure the start and end times are different and seqentialif (endTime.TotalMilliseconds <= startTime.TotalMilliseconds)diff --git a/MediaBrowser.Model/Configuration/LibraryOptions.cs b/MediaBrowser.Model/Configuration/LibraryOptions.csindex ec9b276a0b..b3d035be21 100644--- a/MediaBrowser.Model/Configuration/LibraryOptions.cs+++ b/MediaBrowser.Model/Configuration/LibraryOptions.cs@@ -100,7 +100,7 @@ namespace MediaBrowser.Model.Configurationpublic ImageOption GetImageOptions(ImageType type){- foreach (ImageOption i in ImageOptions)+ foreach (var i in ImageOptions){if (i.Type == type){@@ -111,7 +111,7 @@ namespace MediaBrowser.Model.ConfigurationImageOption[] options;if (DefaultImageOptions.TryGetValue(Type, out options)){- foreach (ImageOption i in options)+ foreach (var i in options){if (i.Type == type){diff --git a/MediaBrowser.Model/Dlna/ConditionProcessor.cs b/MediaBrowser.Model/Dlna/ConditionProcessor.csindex fe89267351..ae7d17275b 100644--- a/MediaBrowser.Model/Dlna/ConditionProcessor.cs+++ b/MediaBrowser.Model/Dlna/ConditionProcessor.cs@@ -267,7 +267,7 @@ namespace MediaBrowser.Model.Dlnareturn !condition.IsRequired;}- TransportStreamTimestamp expected = (TransportStreamTimestamp)Enum.Parse(typeof(TransportStreamTimestamp), condition.Value, true);+ var expected = (TransportStreamTimestamp)Enum.Parse(typeof(TransportStreamTimestamp), condition.Value, true);switch (condition.Condition){diff --git a/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs b/MediaBrowser.Model/Dlna/ContentFeatureBuilder.csindex ecca415d3d..b71531bf1b 100644--- a/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs+++ b/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs@@ -24,14 +24,14 @@ namespace MediaBrowser.Model.Dlna// 0 = native, 1 = transcodedvar orgCi = isDirectStream ? ";DLNA.ORG_CI=0" : ";DLNA.ORG_CI=1";- DlnaFlags flagValue = DlnaFlags.BackgroundTransferMode |+ var flagValue = DlnaFlags.BackgroundTransferMode |DlnaFlags.InteractiveTransferMode |DlnaFlags.DlnaV15;string dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}",DlnaMaps.FlagsToString(flagValue));- ResponseProfile mediaProfile = _profile.GetImageMediaProfile(container,+ var mediaProfile = _profile.GetImageMediaProfile(container,width,height);@@ -66,7 +66,7 @@ namespace MediaBrowser.Model.Dlna// 0 = native, 1 = transcodedstring orgCi = isDirectStream ? ";DLNA.ORG_CI=0" : ";DLNA.ORG_CI=1";- DlnaFlags flagValue = DlnaFlags.StreamingTransferMode |+ var flagValue = DlnaFlags.StreamingTransferMode |DlnaFlags.BackgroundTransferMode |DlnaFlags.InteractiveTransferMode |DlnaFlags.DlnaV15;@@ -83,7 +83,7 @@ namespace MediaBrowser.Model.Dlnastring dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}",DlnaMaps.FlagsToString(flagValue));- ResponseProfile mediaProfile = _profile.GetAudioMediaProfile(container,+ var mediaProfile = _profile.GetAudioMediaProfile(container,audioCodec,audioChannels,audioBitrate,@@ -131,7 +131,7 @@ namespace MediaBrowser.Model.Dlna// 0 = native, 1 = transcodedstring orgCi = isDirectStream ? ";DLNA.ORG_CI=0" : ";DLNA.ORG_CI=1";- DlnaFlags flagValue = DlnaFlags.StreamingTransferMode |+ var flagValue = DlnaFlags.StreamingTransferMode |DlnaFlags.BackgroundTransferMode |DlnaFlags.InteractiveTransferMode |DlnaFlags.DlnaV15;@@ -148,7 +148,7 @@ namespace MediaBrowser.Model.Dlnastring dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}",DlnaMaps.FlagsToString(flagValue));- ResponseProfile mediaProfile = _profile.GetVideoMediaProfile(container,+ var mediaProfile = _profile.GetVideoMediaProfile(container,audioCodec,videoCodec,width,@@ -168,7 +168,7 @@ namespace MediaBrowser.Model.DlnavideoCodecTag,isAvc);- List<string> orgPnValues = new List<string>();+ var orgPnValues = new List<string>();if (mediaProfile != null && !string.IsNullOrEmpty(mediaProfile.OrgPn)){@@ -183,7 +183,7 @@ namespace MediaBrowser.Model.Dlna}}- List<string> contentFeatureList = new List<string>();+ var contentFeatureList = new List<string>();foreach (string orgPn in orgPnValues){diff --git a/MediaBrowser.Model/Dlna/DeviceProfile.cs b/MediaBrowser.Model/Dlna/DeviceProfile.csindex 3a626deaa0..8124cf5289 100644--- a/MediaBrowser.Model/Dlna/DeviceProfile.cs+++ b/MediaBrowser.Model/Dlna/DeviceProfile.cs@@ -21,7 +21,7 @@ namespace MediaBrowser.Model.Dlna/// Gets or sets the identification./// </summary>/// <value>The identification.</value>- public MediaBrowser.Model.Dlna.DeviceIdentification Identification { get; set; }+ public DeviceIdentification Identification { get; set; }public string FriendlyName { get; set; }public string Manufacturer { get; set; }@@ -191,7 +191,7 @@ namespace MediaBrowser.Model.Dlnavar conditionProcessor = new ConditionProcessor();var anyOff = false;- foreach (ProfileCondition c in i.Conditions)+ foreach (var c in i.Conditions){if (!conditionProcessor.IsAudioConditionSatisfied(GetModelProfileCondition(c), audioChannels, audioBitrate, audioSampleRate, audioBitDepth)){@@ -238,7 +238,7 @@ namespace MediaBrowser.Model.Dlnavar conditionProcessor = new ConditionProcessor();var anyOff = false;- foreach (ProfileCondition c in i.Conditions)+ foreach (var c in i.Conditions){if (!conditionProcessor.IsImageConditionSatisfied(GetModelProfileCondition(c), width, height)){@@ -304,7 +304,7 @@ namespace MediaBrowser.Model.Dlnavar conditionProcessor = new ConditionProcessor();var anyOff = false;- foreach (ProfileCondition c in i.Conditions)+ foreach (var c in i.Conditions){if (!conditionProcessor.IsVideoConditionSatisfied(GetModelProfileCondition(c), width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isInterlaced, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc)){diff --git a/MediaBrowser.Model/Dlna/MediaFormatProfileResolver.cs b/MediaBrowser.Model/Dlna/MediaFormatProfileResolver.csindex 42c78e335f..672784589f 100644--- a/MediaBrowser.Model/Dlna/MediaFormatProfileResolver.cs+++ b/MediaBrowser.Model/Dlna/MediaFormatProfileResolver.cs@@ -91,7 +91,7 @@ namespace MediaBrowser.Model.Dlnaif (StringHelper.EqualsIgnoreCase(videoCodec, "mpeg2video")){- List<MediaFormatProfile> list = new List<MediaFormatProfile>();+ var list = new List<MediaFormatProfile>();list.Add(ValueOf("MPEG_TS_SD_NA" + suffix));list.Add(ValueOf("MPEG_TS_SD_EU" + suffix));diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.csindex f1ec71d1d9..2335f0553e 100644--- a/MediaBrowser.Model/Dlna/StreamBuilder.cs+++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs@@ -32,7 +32,7 @@ namespace MediaBrowser.Model.DlnaValidateAudioInput(options);var mediaSources = new List<MediaSourceInfo>();- foreach (MediaSourceInfo i in options.MediaSources)+ foreach (var i in options.MediaSources){if (string.IsNullOrEmpty(options.MediaSourceId) ||StringHelper.EqualsIgnoreCase(i.Id, options.MediaSourceId))@@ -42,16 +42,16 @@ namespace MediaBrowser.Model.Dlna}var streams = new List<StreamInfo>();- foreach (MediaSourceInfo i in mediaSources)+ foreach (var i in mediaSources){- StreamInfo streamInfo = BuildAudioItem(i, options);+ var streamInfo = BuildAudioItem(i, options);if (streamInfo != null){streams.Add(streamInfo);}}- foreach (StreamInfo stream in streams)+ foreach (var stream in streams){stream.DeviceId = options.DeviceId;stream.DeviceProfileId = options.Profile.Id;@@ -65,7 +65,7 @@ namespace MediaBrowser.Model.DlnaValidateInput(options);var mediaSources = new List<MediaSourceInfo>();- foreach (MediaSourceInfo i in options.MediaSources)+ foreach (var i in options.MediaSources){if (string.IsNullOrEmpty(options.MediaSourceId) ||StringHelper.EqualsIgnoreCase(i.Id, options.MediaSourceId))@@ -75,16 +75,16 @@ namespace MediaBrowser.Model.Dlna}var streams = new List<StreamInfo>();- foreach (MediaSourceInfo i in mediaSources)+ foreach (var i in mediaSources){- StreamInfo streamInfo = BuildVideoItem(i, options);+ var streamInfo = BuildVideoItem(i, options);if (streamInfo != null){streams.Add(streamInfo);}}- foreach (StreamInfo stream in streams)+ foreach (var stream in streams){stream.DeviceId = options.DeviceId;stream.DeviceProfileId = options.Profile.Id;@@ -97,7 +97,7 @@ namespace MediaBrowser.Model.Dlna{var sorted = SortMediaSources(streams, maxBitrate);- foreach (StreamInfo stream in sorted)+ foreach (var stream in sorted){return stream;}@@ -284,7 +284,7 @@ namespace MediaBrowser.Model.Dlna{var transcodeReasons = new List<TranscodeReason>();- StreamInfo playlistItem = new StreamInfo+ var playlistItem = new StreamInfo{ItemId = options.ItemId,MediaType = DlnaProfileType.Audio,@@ -308,14 +308,14 @@ namespace MediaBrowser.Model.Dlnareturn playlistItem;}- MediaStream audioStream = item.GetDefaultAudioStream(null);+ var audioStream = item.GetDefaultAudioStream(null);var directPlayInfo = GetAudioDirectPlayMethods(item, audioStream, options);var directPlayMethods = directPlayInfo.Item1;transcodeReasons.AddRange(directPlayInfo.Item2);- ConditionProcessor conditionProcessor = new ConditionProcessor();+ var conditionProcessor = new ConditionProcessor();int? inputAudioChannels = audioStream == null ? null : audioStream.Channels;int? inputAudioBitrate = audioStream == null ? null : audioStream.BitDepth;@@ -328,12 +328,12 @@ namespace MediaBrowser.Model.Dlna// Make sure audio codec profiles are satisfiedvar conditions = new List<ProfileCondition>();- foreach (CodecProfile i in options.Profile.CodecProfiles)+ foreach (var i in options.Profile.CodecProfiles){if (i.Type == CodecType.Audio && i.ContainsAnyCodec(audioCodec, item.Container)){bool applyConditions = true;- foreach (ProfileCondition applyCondition in i.ApplyConditions)+ foreach (var applyCondition in i.ApplyConditions){if (!conditionProcessor.IsAudioConditionSatisfied(applyCondition, inputAudioChannels, inputAudioBitrate, inputAudioSampleRate, inputAudioBitDepth)){@@ -345,7 +345,7 @@ namespace MediaBrowser.Model.Dlnaif (applyConditions){- foreach (ProfileCondition c in i.Conditions)+ foreach (var c in i.Conditions){conditions.Add(c);}@@ -354,7 +354,7 @@ namespace MediaBrowser.Model.Dlna}bool all = true;- foreach (ProfileCondition c in conditions)+ foreach (var c in conditions){if (!conditionProcessor.IsAudioConditionSatisfied(c, inputAudioChannels, inputAudioBitrate, inputAudioSampleRate, inputAudioBitDepth)){@@ -383,7 +383,7 @@ namespace MediaBrowser.Model.Dlna}TranscodingProfile transcodingProfile = null;- foreach (TranscodingProfile i in options.Profile.TranscodingProfiles)+ foreach (var i in options.Profile.TranscodingProfiles){if (i.Type == playlistItem.MediaType && i.Context == options.Context){@@ -405,7 +405,7 @@ namespace MediaBrowser.Model.DlnaSetStreamInfoOptionsFromTranscodingProfile(playlistItem, transcodingProfile);var audioCodecProfiles = new List<CodecProfile>();- foreach (CodecProfile i in options.Profile.CodecProfiles)+ foreach (var i in options.Profile.CodecProfiles){if (i.Type == CodecType.Audio && i.ContainsAnyCodec(transcodingProfile.AudioCodec, transcodingProfile.Container)){@@ -416,10 +416,10 @@ namespace MediaBrowser.Model.Dlna}var audioTranscodingConditions = new List<ProfileCondition>();- foreach (CodecProfile i in audioCodecProfiles)+ foreach (var i in audioCodecProfiles){bool applyConditions = true;- foreach (ProfileCondition applyCondition in i.ApplyConditions)+ foreach (var applyCondition in i.ApplyConditions){if (!conditionProcessor.IsAudioConditionSatisfied(applyCondition, inputAudioChannels, inputAudioBitrate, inputAudioSampleRate, inputAudioBitDepth)){@@ -431,7 +431,7 @@ namespace MediaBrowser.Model.Dlnaif (applyConditions){- foreach (ProfileCondition c in i.Conditions)+ foreach (var c in i.Conditions){audioTranscodingConditions.Add(c);}@@ -478,7 +478,7 @@ namespace MediaBrowser.Model.Dlnavar transcodeReasons = new List<TranscodeReason>();DirectPlayProfile directPlayProfile = null;- foreach (DirectPlayProfile i in options.Profile.DirectPlayProfiles)+ foreach (var i in options.Profile.DirectPlayProfiles){if (i.Type == DlnaProfileType.Audio && IsAudioDirectPlaySupported(i, item, audioStream)){@@ -607,7 +607,7 @@ namespace MediaBrowser.Model.Dlna{int highestScore = -1;- foreach (MediaStream stream in item.MediaStreams)+ foreach (var stream in item.MediaStreams){if (stream.Type == MediaStreamType.Subtitle && stream.Score.HasValue){@@ -619,7 +619,7 @@ namespace MediaBrowser.Model.Dlna}var topStreams = new List<MediaStream>();- foreach (MediaStream stream in item.MediaStreams)+ foreach (var stream in item.MediaStreams){if (stream.Type == MediaStreamType.Subtitle && stream.Score.HasValue && stream.Score.Value == highestScore){@@ -630,9 +630,9 @@ namespace MediaBrowser.Model.Dlna// If multiple streams have an equal score, try to pick the most efficient oneif (topStreams.Count > 1){- foreach (MediaStream stream in topStreams)+ foreach (var stream in topStreams){- foreach (SubtitleProfile profile in subtitleProfiles)+ foreach (var profile in subtitleProfiles){if (profile.Method == SubtitleDeliveryMethod.External && StringHelper.EqualsIgnoreCase(profile.Format, stream.Codec)){@@ -705,7 +705,7 @@ namespace MediaBrowser.Model.Dlnavar transcodeReasons = new List<TranscodeReason>();- StreamInfo playlistItem = new StreamInfo+ var playlistItem = new StreamInfo{ItemId = options.ItemId,MediaType = DlnaProfileType.Video,@@ -716,15 +716,15 @@ namespace MediaBrowser.Model.Dlna};playlistItem.SubtitleStreamIndex = options.SubtitleStreamIndex ?? GetDefaultSubtitleStreamIndex(item, options.Profile.SubtitleProfiles);- MediaStream subtitleStream = playlistItem.SubtitleStreamIndex.HasValue ? item.GetMediaStream(MediaStreamType.Subtitle, playlistItem.SubtitleStreamIndex.Value) : null;+ var subtitleStream = playlistItem.SubtitleStreamIndex.HasValue ? item.GetMediaStream(MediaStreamType.Subtitle, playlistItem.SubtitleStreamIndex.Value) : null;- MediaStream audioStream = item.GetDefaultAudioStream(options.AudioStreamIndex ?? item.DefaultAudioStreamIndex);+ var audioStream = item.GetDefaultAudioStream(options.AudioStreamIndex ?? item.DefaultAudioStreamIndex);if (audioStream != null){playlistItem.AudioStreamIndex = audioStream.Index;}- MediaStream videoStream = item.VideoStream;+ var videoStream = item.VideoStream;// TODO: This doesn't accout for situation of device being able to handle media bitrate, but wifi connection not fast enoughvar directPlayEligibilityResult = IsEligibleForDirectPlay(item, GetBitrateForDirectPlayCheck(item, options, true) ?? 0, subtitleStream, options, PlayMethod.DirectPlay);@@ -751,7 +751,7 @@ namespace MediaBrowser.Model.Dlnaif (subtitleStream != null){- SubtitleProfile subtitleProfile = GetSubtitleProfile(item, subtitleStream, options.Profile.SubtitleProfiles, directPlay.Value, _transcoderSupport, item.Container, null);+ var subtitleProfile = GetSubtitleProfile(item, subtitleStream, options.Profile.SubtitleProfiles, directPlay.Value, _transcoderSupport, item.Container, null);playlistItem.SubtitleDeliveryMethod = subtitleProfile.Method;playlistItem.SubtitleFormat = subtitleProfile.Format;@@ -775,7 +775,7 @@ namespace MediaBrowser.Model.Dlna// Can't direct play, find the transcoding profileTranscodingProfile transcodingProfile = null;- foreach (TranscodingProfile i in options.Profile.TranscodingProfiles)+ foreach (var i in options.Profile.TranscodingProfiles){if (i.Type == playlistItem.MediaType && i.Context == options.Context){@@ -793,7 +793,7 @@ namespace MediaBrowser.Model.Dlnaif (subtitleStream != null){- SubtitleProfile subtitleProfile = GetSubtitleProfile(item, subtitleStream, options.Profile.SubtitleProfiles, PlayMethod.Transcode, _transcoderSupport, transcodingProfile.Container, transcodingProfile.Protocol);+ var subtitleProfile = GetSubtitleProfile(item, subtitleStream, options.Profile.SubtitleProfiles, PlayMethod.Transcode, _transcoderSupport, transcodingProfile.Container, transcodingProfile.Protocol);playlistItem.SubtitleDeliveryMethod = subtitleProfile.Method;playlistItem.SubtitleFormat = subtitleProfile.Format;@@ -804,15 +804,15 @@ namespace MediaBrowser.Model.DlnaSetStreamInfoOptionsFromTranscodingProfile(playlistItem, transcodingProfile);- ConditionProcessor conditionProcessor = new ConditionProcessor();+ var conditionProcessor = new ConditionProcessor();var isFirstAppliedCodecProfile = true;- foreach (CodecProfile i in options.Profile.CodecProfiles)+ foreach (var i in options.Profile.CodecProfiles){if (i.Type == CodecType.Video && i.ContainsAnyCodec(transcodingProfile.VideoCodec, transcodingProfile.Container)){bool applyConditions = true;- foreach (ProfileCondition applyCondition in i.ApplyConditions)+ foreach (var applyCondition in i.ApplyConditions){int? width = videoStream == null ? null : videoStream.Width;int? height = videoStream == null ? null : videoStream.Height;@@ -863,12 +863,12 @@ namespace MediaBrowser.Model.DlnaplaylistItem.AudioBitrate = Math.Min(playlistItem.AudioBitrate ?? audioBitrate, audioBitrate);isFirstAppliedCodecProfile = true;- foreach (CodecProfile i in options.Profile.CodecProfiles)+ foreach (var i in options.Profile.CodecProfiles){if (i.Type == CodecType.VideoAudio && i.ContainsAnyCodec(transcodingProfile.AudioCodec, transcodingProfile.Container)){bool applyConditions = true;- foreach (ProfileCondition applyCondition in i.ApplyConditions)+ foreach (var applyCondition in i.ApplyConditions){bool? isSecondaryAudio = audioStream == null ? null : item.IsSecondaryAudio(audioStream);int? inputAudioBitrate = audioStream == null ? null : audioStream.BitRate;@@ -998,7 +998,7 @@ namespace MediaBrowser.Model.Dlnabool isEligibleForDirectPlay,bool isEligibleForDirectStream){- DeviceProfile profile = options.Profile;+ var profile = options.Profile;if (options.ForceDirectPlay){@@ -1011,7 +1011,7 @@ namespace MediaBrowser.Model.Dlna// See if it can be direct playedDirectPlayProfile directPlay = null;- foreach (DirectPlayProfile i in profile.DirectPlayProfiles)+ foreach (var i in profile.DirectPlayProfiles){if (i.Type == DlnaProfileType.Video && IsVideoDirectPlaySupported(i, mediaSource, videoStream, audioStream)){@@ -1032,19 +1032,19 @@ namespace MediaBrowser.Model.Dlnastring container = mediaSource.Container;var conditions = new List<ProfileCondition>();- foreach (ContainerProfile i in profile.ContainerProfiles)+ foreach (var i in profile.ContainerProfiles){if (i.Type == DlnaProfileType.Video &&i.ContainsContainer(container)){- foreach (ProfileCondition c in i.Conditions)+ foreach (var c in i.Conditions){conditions.Add(c);}}}- ConditionProcessor conditionProcessor = new ConditionProcessor();+ var conditionProcessor = new ConditionProcessor();int? width = videoStream == null ? null : videoStream.Width;int? height = videoStream == null ? null : videoStream.Height;@@ -1072,7 +1072,7 @@ namespace MediaBrowser.Model.Dlnaint? numVideoStreams = mediaSource.GetStreamCount(MediaStreamType.Video);// Check container conditions- foreach (ProfileCondition i in conditions)+ foreach (var i in conditions){if (!conditionProcessor.IsVideoConditionSatisfied(i, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isInterlaced, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc)){@@ -1090,12 +1090,12 @@ namespace MediaBrowser.Model.Dlnastring videoCodec = videoStream == null ? null : videoStream.Codec;conditions = new List<ProfileCondition>();- foreach (CodecProfile i in profile.CodecProfiles)+ foreach (var i in profile.CodecProfiles){if (i.Type == CodecType.Video && i.ContainsAnyCodec(videoCodec, container)){bool applyConditions = true;- foreach (ProfileCondition applyCondition in i.ApplyConditions)+ foreach (var applyCondition in i.ApplyConditions){if (!conditionProcessor.IsVideoConditionSatisfied(applyCondition, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isInterlaced, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc)){@@ -1107,7 +1107,7 @@ namespace MediaBrowser.Model.Dlnaif (applyConditions){- foreach (ProfileCondition c in i.Conditions)+ foreach (var c in i.Conditions){conditions.Add(c);}@@ -1115,7 +1115,7 @@ namespace MediaBrowser.Model.Dlna}}- foreach (ProfileCondition i in conditions)+ foreach (var i in conditions){if (!conditionProcessor.IsVideoConditionSatisfied(i, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isInterlaced, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc)){@@ -1137,12 +1137,12 @@ namespace MediaBrowser.Model.Dlnaconditions = new List<ProfileCondition>();bool? isSecondaryAudio = audioStream == null ? null : mediaSource.IsSecondaryAudio(audioStream);- foreach (CodecProfile i in profile.CodecProfiles)+ foreach (var i in profile.CodecProfiles){if (i.Type == CodecType.VideoAudio && i.ContainsAnyCodec(audioCodec, container)){bool applyConditions = true;- foreach (ProfileCondition applyCondition in i.ApplyConditions)+ foreach (var applyCondition in i.ApplyConditions){if (!conditionProcessor.IsVideoAudioConditionSatisfied(applyCondition, audioChannels, audioBitrate, audioSampleRate, audioBitDepth, audioProfile, isSecondaryAudio)){@@ -1154,7 +1154,7 @@ namespace MediaBrowser.Model.Dlnaif (applyConditions){- foreach (ProfileCondition c in i.Conditions)+ foreach (var c in i.Conditions){conditions.Add(c);}@@ -1162,7 +1162,7 @@ namespace MediaBrowser.Model.Dlna}}- foreach (ProfileCondition i in conditions)+ foreach (var i in conditions){if (!conditionProcessor.IsVideoAudioConditionSatisfied(i, audioChannels, audioBitrate, audioSampleRate, audioBitDepth, audioProfile, isSecondaryAudio)){@@ -1206,7 +1206,7 @@ namespace MediaBrowser.Model.Dlna{if (subtitleStream != null){- SubtitleProfile subtitleProfile = GetSubtitleProfile(item, subtitleStream, options.Profile.SubtitleProfiles, playMethod, _transcoderSupport, item.Container, null);+ var subtitleProfile = GetSubtitleProfile(item, subtitleStream, options.Profile.SubtitleProfiles, playMethod, _transcoderSupport, item.Container, null);if (subtitleProfile.Method != SubtitleDeliveryMethod.External && subtitleProfile.Method != SubtitleDeliveryMethod.Embed){@@ -1230,7 +1230,7 @@ namespace MediaBrowser.Model.Dlnaif (!subtitleStream.IsExternal && (playMethod != PlayMethod.Transcode || !string.Equals(transcodingSubProtocol, "hls", StringComparison.OrdinalIgnoreCase))){// Look for supported embedded subs of the same format- foreach (SubtitleProfile profile in subtitleProfiles)+ foreach (var profile in subtitleProfiles){if (!profile.SupportsLanguage(subtitleStream.Language)){@@ -1259,7 +1259,7 @@ namespace MediaBrowser.Model.Dlna}// Look for supported embedded subs of a convertible format- foreach (SubtitleProfile profile in subtitleProfiles)+ foreach (var profile in subtitleProfiles){if (!profile.SupportsLanguage(subtitleStream.Language)){@@ -1328,7 +1328,7 @@ namespace MediaBrowser.Model.Dlnaprivate static SubtitleProfile GetExternalSubtitleProfile(MediaSourceInfo mediaSource, MediaStream subtitleStream, SubtitleProfile[] subtitleProfiles, PlayMethod playMethod, ITranscoderSupport transcoderSupport, bool allowConversion){- foreach (SubtitleProfile profile in subtitleProfiles)+ foreach (var profile in subtitleProfiles){if (profile.Method != SubtitleDeliveryMethod.External && profile.Method != SubtitleDeliveryMethod.Hls){@@ -1467,7 +1467,7 @@ namespace MediaBrowser.Model.Dlnaprivate void ApplyTranscodingConditions(StreamInfo item, IEnumerable<ProfileCondition> conditions, string qualifier, bool enableQualifiedConditions, bool enableNonQualifiedConditions){- foreach (ProfileCondition condition in conditions)+ foreach (var condition in conditions){string value = condition.Value;diff --git a/MediaBrowser.Model/Dlna/StreamInfo.cs b/MediaBrowser.Model/Dlna/StreamInfo.csindex 86d7c9d621..84bd1f4299 100644--- a/MediaBrowser.Model/Dlna/StreamInfo.cs+++ b/MediaBrowser.Model/Dlna/StreamInfo.cs@@ -145,8 +145,8 @@ namespace MediaBrowser.Model.Dlnathrow new ArgumentNullException(nameof(baseUrl));}- List<string> list = new List<string>();- foreach (NameValuePair pair in BuildParams(this, accessToken))+ var list = new List<string>();+ foreach (var pair in BuildParams(this, accessToken)){if (string.IsNullOrEmpty(pair.Value)){@@ -211,7 +211,7 @@ namespace MediaBrowser.Model.Dlnaprivate static List<NameValuePair> BuildParams(StreamInfo item, string accessToken){- List<NameValuePair> list = new List<NameValuePair>();+ var list = new List<NameValuePair>();string audioCodecs = item.AudioCodecs.Length == 0 ?string.Empty :@@ -346,11 +346,11 @@ namespace MediaBrowser.Model.Dlnapublic List<SubtitleStreamInfo> GetExternalSubtitles(ITranscoderSupport transcoderSupport, bool includeSelectedTrackOnly, bool enableAllProfiles, string baseUrl, string accessToken){- List<SubtitleStreamInfo> list = GetSubtitleProfiles(transcoderSupport, includeSelectedTrackOnly, enableAllProfiles, baseUrl, accessToken);- List<SubtitleStreamInfo> newList = new List<SubtitleStreamInfo>();+ var list = GetSubtitleProfiles(transcoderSupport, includeSelectedTrackOnly, enableAllProfiles, baseUrl, accessToken);+ var newList = new List<SubtitleStreamInfo>();// First add the selected track- foreach (SubtitleStreamInfo stream in list)+ foreach (var stream in list){if (stream.DeliveryMethod == SubtitleDeliveryMethod.External){@@ -368,7 +368,7 @@ namespace MediaBrowser.Model.Dlnapublic List<SubtitleStreamInfo> GetSubtitleProfiles(ITranscoderSupport transcoderSupport, bool includeSelectedTrackOnly, bool enableAllProfiles, string baseUrl, string accessToken){- List<SubtitleStreamInfo> list = new List<SubtitleStreamInfo>();+ var list = new List<SubtitleStreamInfo>();// HLS will preserve timestamps so we can just grab the full subtitle streamlong startPositionTicks = StringHelper.EqualsIgnoreCase(SubProtocol, "hls")@@ -378,7 +378,7 @@ namespace MediaBrowser.Model.Dlna// First add the selected trackif (SubtitleStreamIndex.HasValue){- foreach (MediaStream stream in MediaSource.MediaStreams)+ foreach (var stream in MediaSource.MediaStreams){if (stream.Type == MediaStreamType.Subtitle && stream.Index == SubtitleStreamIndex.Value){@@ -389,7 +389,7 @@ namespace MediaBrowser.Model.Dlnaif (!includeSelectedTrackOnly){- foreach (MediaStream stream in MediaSource.MediaStreams)+ foreach (var stream in MediaSource.MediaStreams){if (stream.Type == MediaStreamType.Subtitle && (!SubtitleStreamIndex.HasValue || stream.Index != SubtitleStreamIndex.Value)){@@ -405,16 +405,16 @@ namespace MediaBrowser.Model.Dlna{if (enableAllProfiles){- foreach (SubtitleProfile profile in DeviceProfile.SubtitleProfiles)+ foreach (var profile in DeviceProfile.SubtitleProfiles){- SubtitleStreamInfo info = GetSubtitleStreamInfo(stream, baseUrl, accessToken, startPositionTicks, new[] { profile }, transcoderSupport);+ var info = GetSubtitleStreamInfo(stream, baseUrl, accessToken, startPositionTicks, new[] { profile }, transcoderSupport);list.Add(info);}}else{- SubtitleStreamInfo info = GetSubtitleStreamInfo(stream, baseUrl, accessToken, startPositionTicks, DeviceProfile.SubtitleProfiles, transcoderSupport);+ var info = GetSubtitleStreamInfo(stream, baseUrl, accessToken, startPositionTicks, DeviceProfile.SubtitleProfiles, transcoderSupport);list.Add(info);}@@ -422,8 +422,8 @@ namespace MediaBrowser.Model.Dlnaprivate SubtitleStreamInfo GetSubtitleStreamInfo(MediaStream stream, string baseUrl, string accessToken, long startPositionTicks, SubtitleProfile[] subtitleProfiles, ITranscoderSupport transcoderSupport){- SubtitleProfile subtitleProfile = StreamBuilder.GetSubtitleProfile(MediaSource, stream, subtitleProfiles, PlayMethod, transcoderSupport, Container, SubProtocol);- SubtitleStreamInfo info = new SubtitleStreamInfo+ var subtitleProfile = StreamBuilder.GetSubtitleProfile(MediaSource, stream, subtitleProfiles, PlayMethod, transcoderSupport, Container, SubProtocol);+ var info = new SubtitleStreamInfo{IsForced = stream.IsForced,Language = stream.Language,@@ -502,7 +502,7 @@ namespace MediaBrowser.Model.Dlna{get{- MediaStream stream = TargetAudioStream;+ var stream = TargetAudioStream;return stream == null ? null : stream.SampleRate;}}@@ -584,7 +584,7 @@ namespace MediaBrowser.Model.Dlna{get{- MediaStream stream = TargetVideoStream;+ var stream = TargetVideoStream;return MaxFramerate.HasValue && !IsDirectStream? MaxFramerate: stream == null ? null : stream.AverageFrameRate ?? stream.RealFrameRate;@@ -689,7 +689,7 @@ namespace MediaBrowser.Model.Dlna{get{- MediaStream stream = TargetVideoStream;+ var stream = TargetVideoStream;return !IsDirectStream? null: stream == null ? null : stream.PacketLength;@@ -727,7 +727,7 @@ namespace MediaBrowser.Model.Dlna{get{- MediaStream stream = TargetVideoStream;+ var stream = TargetVideoStream;return !IsDirectStream? null: stream == null ? null : stream.CodecTag;@@ -741,7 +741,7 @@ namespace MediaBrowser.Model.Dlna{get{- MediaStream stream = TargetAudioStream;+ var stream = TargetAudioStream;return AudioBitrate.HasValue && !IsDirectStream? AudioBitrate: stream == null ? null : stream.BitRate;@@ -797,7 +797,7 @@ namespace MediaBrowser.Model.Dlna{get{- MediaStream stream = TargetAudioStream;+ var stream = TargetAudioStream;string inputCodec = stream == null ? null : stream.Codec;@@ -822,7 +822,7 @@ namespace MediaBrowser.Model.Dlna{get{- MediaStream stream = TargetVideoStream;+ var stream = TargetVideoStream;string inputCodec = stream == null ? null : stream.Codec;@@ -878,7 +878,7 @@ namespace MediaBrowser.Model.Dlna{get{- MediaStream stream = TargetVideoStream;+ var stream = TargetVideoStream;return VideoBitrate.HasValue && !IsDirectStream? VideoBitrate@@ -890,7 +890,7 @@ namespace MediaBrowser.Model.Dlna{get{- TransportStreamTimestamp defaultValue = StringHelper.EqualsIgnoreCase(Container, "m2ts")+ var defaultValue = StringHelper.EqualsIgnoreCase(Container, "m2ts")? TransportStreamTimestamp.Valid: TransportStreamTimestamp.None;@@ -955,11 +955,11 @@ namespace MediaBrowser.Model.Dlna{get{- MediaStream videoStream = TargetVideoStream;+ var videoStream = TargetVideoStream;if (videoStream != null && videoStream.Width.HasValue && videoStream.Height.HasValue){- ImageSize size = new ImageSize+ var size = new ImageSize{Width = videoStream.Width.Value,Height = videoStream.Height.Value@@ -968,7 +968,7 @@ namespace MediaBrowser.Model.Dlnadouble? maxWidth = MaxWidth.HasValue ? (double)MaxWidth.Value : (double?)null;double? maxHeight = MaxHeight.HasValue ? (double)MaxHeight.Value : (double?)null;- ImageSize newSize = DrawingUtils.Resize(size,+ var newSize = DrawingUtils.Resize(size,0,0,maxWidth ?? 0,@@ -985,11 +985,11 @@ namespace MediaBrowser.Model.Dlna{get{- MediaStream videoStream = TargetVideoStream;+ var videoStream = TargetVideoStream;if (videoStream != null && videoStream.Width.HasValue && videoStream.Height.HasValue){- ImageSize size = new ImageSize+ var size = new ImageSize{Width = videoStream.Width.Value,Height = videoStream.Height.Value@@ -998,7 +998,7 @@ namespace MediaBrowser.Model.Dlnadouble? maxWidth = MaxWidth.HasValue ? (double)MaxWidth.Value : (double?)null;double? maxHeight = MaxHeight.HasValue ? (double)MaxHeight.Value : (double?)null;- ImageSize newSize = DrawingUtils.Resize(size,+ var newSize = DrawingUtils.Resize(size,0,0,maxWidth ?? 0,@@ -1059,9 +1059,9 @@ namespace MediaBrowser.Model.Dlnapublic List<MediaStream> GetSelectableStreams(MediaStreamType type){- List<MediaStream> list = new List<MediaStream>();+ var list = new List<MediaStream>();- foreach (MediaStream stream in MediaSource.MediaStreams)+ foreach (var stream in MediaSource.MediaStreams){if (type == stream.Type){diff --git a/MediaBrowser.Model/Dto/MediaSourceInfo.cs b/MediaBrowser.Model/Dto/MediaSourceInfo.csindex c2219dc332..92e40fb01f 100644--- a/MediaBrowser.Model/Dto/MediaSourceInfo.cs+++ b/MediaBrowser.Model/Dto/MediaSourceInfo.cs@@ -120,7 +120,7 @@ namespace MediaBrowser.Model.Dto{var val = defaultIndex.Value;- foreach (MediaStream i in MediaStreams)+ foreach (var i in MediaStreams){if (i.Type == MediaStreamType.Audio && i.Index == val){@@ -129,7 +129,7 @@ namespace MediaBrowser.Model.Dto}}- foreach (MediaStream i in MediaStreams)+ foreach (var i in MediaStreams){if (i.Type == MediaStreamType.Audio && i.IsDefault){@@ -137,7 +137,7 @@ namespace MediaBrowser.Model.Dto}}- foreach (MediaStream i in MediaStreams)+ foreach (var i in MediaStreams){if (i.Type == MediaStreamType.Audio){@@ -153,7 +153,7 @@ namespace MediaBrowser.Model.Dto{get{- foreach (MediaStream i in MediaStreams)+ foreach (var i in MediaStreams){if (i.Type == MediaStreamType.Video){@@ -167,7 +167,7 @@ namespace MediaBrowser.Model.Dtopublic MediaStream GetMediaStream(MediaStreamType type, int index){- foreach (MediaStream i in MediaStreams)+ foreach (var i in MediaStreams){if (i.Type == type && i.Index == index){@@ -183,7 +183,7 @@ namespace MediaBrowser.Model.Dtoint numMatches = 0;int numStreams = 0;- foreach (MediaStream i in MediaStreams)+ foreach (var i in MediaStreams){numStreams++;if (i.Type == type)@@ -203,7 +203,7 @@ namespace MediaBrowser.Model.Dtopublic bool? IsSecondaryAudio(MediaStream stream){// Look for the first audio track marked as default- foreach (MediaStream currentStream in MediaStreams)+ foreach (var currentStream in MediaStreams){if (currentStream.Type == MediaStreamType.Audio && currentStream.IsDefault){@@ -215,7 +215,7 @@ namespace MediaBrowser.Model.Dto}// Look for the first audio track- foreach (MediaStream currentStream in MediaStreams)+ foreach (var currentStream in MediaStreams){if (currentStream.Type == MediaStreamType.Audio){diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.csindex b51942af85..e0c3bead1d 100644--- a/MediaBrowser.Model/Entities/MediaStream.cs+++ b/MediaBrowser.Model/Entities/MediaStream.cs@@ -76,7 +76,7 @@ namespace MediaBrowser.Model.Entities// return AddLanguageIfNeeded(Title);//}- List<string> attributes = new List<string>();+ var attributes = new List<string>();if (!string.IsNullOrEmpty(Language)){@@ -109,7 +109,7 @@ namespace MediaBrowser.Model.Entitiesif (Type == MediaStreamType.Video){- List<string> attributes = new List<string>();+ var attributes = new List<string>();var resolutionText = GetResolutionText();@@ -133,7 +133,7 @@ namespace MediaBrowser.Model.Entities// return AddLanguageIfNeeded(Title);//}- List<string> attributes = new List<string>();+ var attributes = new List<string>();if (!string.IsNullOrEmpty(Language)){diff --git a/MediaBrowser.Model/MediaInfo/LiveStreamRequest.cs b/MediaBrowser.Model/MediaInfo/LiveStreamRequest.csindex edede8ba93..a5ae7c7a51 100644--- a/MediaBrowser.Model/MediaInfo/LiveStreamRequest.cs+++ b/MediaBrowser.Model/MediaInfo/LiveStreamRequest.cs@@ -36,7 +36,7 @@ namespace MediaBrowser.Model.MediaInfoDirectPlayProtocols = new MediaProtocol[] { MediaProtocol.Http };- VideoOptions videoOptions = options as VideoOptions;+ var videoOptions = options as VideoOptions;if (videoOptions != null){AudioStreamIndex = videoOptions.AudioStreamIndex;diff --git a/MediaBrowser.Model/Net/MimeTypes.cs b/MediaBrowser.Model/Net/MimeTypes.csindex e5d1ab462a..77cba0f716 100644--- a/MediaBrowser.Model/Net/MimeTypes.cs+++ b/MediaBrowser.Model/Net/MimeTypes.cs@@ -48,7 +48,7 @@ namespace MediaBrowser.Model.Netprivate static Dictionary<string, string> GetVideoFileExtensionsDictionary(){- Dictionary<string, string> dict = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);+ var dict = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);foreach (string ext in VideoFileExtensions){@@ -65,7 +65,7 @@ namespace MediaBrowser.Model.Netprivate static Dictionary<string, string> GetMimeTypeLookup(){- Dictionary<string, string> dict = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);+ var dict = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);dict.Add(".jpg", "image/jpeg");dict.Add(".jpeg", "image/jpeg");diff --git a/MediaBrowser.Model/Notifications/NotificationOptions.cs b/MediaBrowser.Model/Notifications/NotificationOptions.csindex f48b5ee7fc..cf85554233 100644--- a/MediaBrowser.Model/Notifications/NotificationOptions.cs+++ b/MediaBrowser.Model/Notifications/NotificationOptions.cs@@ -77,7 +77,7 @@ namespace MediaBrowser.Model.Notificationspublic NotificationOption GetOptions(string type){- foreach (NotificationOption i in Options)+ foreach (var i in Options){if (StringHelper.EqualsIgnoreCase(type, i.Type)) return i;}@@ -86,14 +86,14 @@ namespace MediaBrowser.Model.Notificationspublic bool IsEnabled(string type){- NotificationOption opt = GetOptions(type);+ var opt = GetOptions(type);return opt != null && opt.Enabled;}public bool IsServiceEnabled(string service, string notificationType){- NotificationOption opt = GetOptions(notificationType);+ var opt = GetOptions(notificationType);return opt == null ||!ListHelper.ContainsIgnoreCase(opt.DisabledServices, service);@@ -101,7 +101,7 @@ namespace MediaBrowser.Model.Notificationspublic bool IsEnabledToMonitorUser(string type, Guid userId){- NotificationOption opt = GetOptions(type);+ var opt = GetOptions(type);return opt != null && opt.Enabled &&!ListHelper.ContainsIgnoreCase(opt.DisabledMonitorUsers, userId.ToString(""));@@ -109,7 +109,7 @@ namespace MediaBrowser.Model.Notificationspublic bool IsEnabledToSendToUser(string type, string userId, UserPolicy userPolicy){- NotificationOption opt = GetOptions(type);+ var opt = GetOptions(type);if (opt != null && opt.Enabled){diff --git a/MediaBrowser.Model/Services/HttpUtility.cs b/MediaBrowser.Model/Services/HttpUtility.csindex 98882e1146..be180334c6 100644--- a/MediaBrowser.Model/Services/HttpUtility.cs+++ b/MediaBrowser.Model/Services/HttpUtility.cs@@ -445,8 +445,8 @@ namespace MediaBrowser.Model.Servicesif (s.IndexOf('&') == -1)return s;- StringBuilder entity = new StringBuilder();- StringBuilder output = new StringBuilder();+ var entity = new StringBuilder();+ var output = new StringBuilder();int len = s.Length;// 0 -> nothing,// 1 -> right after '&'@@ -623,7 +623,7 @@ namespace MediaBrowser.Model.Servicesif (query[0] == '?')query = query.Substring(1);- QueryParamCollection result = new QueryParamCollection();+ var result = new QueryParamCollection();ParseQueryString(query, encoding, result);return result;}diff --git a/MediaBrowser.Model/System/IEnvironmentInfo.cs b/MediaBrowser.Model/System/IEnvironmentInfo.csindex 757d3c949c..3ffcc7de14 100644--- a/MediaBrowser.Model/System/IEnvironmentInfo.cs+++ b/MediaBrowser.Model/System/IEnvironmentInfo.cs@@ -4,7 +4,7 @@ namespace MediaBrowser.Model.System{public interface IEnvironmentInfo{- MediaBrowser.Model.System.OperatingSystem OperatingSystem { get; }+ OperatingSystem OperatingSystem { get; }string OperatingSystemName { get; }string OperatingSystemVersion { get; }Architecture SystemArchitecture { get; }diff --git a/MediaBrowser.Providers/Manager/GenericPriorityQueue.cs b/MediaBrowser.Providers/Manager/GenericPriorityQueue.csindex 2b73fdcd37..b87f688e16 100644--- a/MediaBrowser.Providers/Manager/GenericPriorityQueue.cs+++ b/MediaBrowser.Providers/Manager/GenericPriorityQueue.cs@@ -132,7 +132,7 @@ namespace Priority_Queueint parent = node.QueueIndex / 2;while (parent >= 1){- TItem parentNode = _nodes[parent];+ var parentNode = _nodes[parent];if (HasHigherPriority(parentNode, node))break;@@ -163,7 +163,7 @@ namespace Priority_Queuebreak;}- TItem childLeft = _nodes[childLeftIndex];+ var childLeft = _nodes[childLeftIndex];if (HasHigherPriority(childLeft, newParent)){newParent = childLeft;@@ -173,7 +173,7 @@ namespace Priority_Queueint childRightIndex = childLeftIndex + 1;if (childRightIndex <= _numNodes){- TItem childRight = _nodes[childRightIndex];+ var childRight = _nodes[childRightIndex];if (HasHigherPriority(childRight, newParent)){newParent = childRight;@@ -234,7 +234,7 @@ namespace Priority_Queue}#endif- TItem returnMe = _nodes[1];+ var returnMe = _nodes[1];Remove(returnMe);item = returnMe;return true;@@ -316,7 +316,7 @@ namespace Priority_Queue{//Bubble the updated node up or down as appropriateint parentIndex = node.QueueIndex / 2;- TItem parentNode = _nodes[parentIndex];+ var parentNode = _nodes[parentIndex];if (parentIndex > 0 && HasHigherPriority(node, parentNode)){@@ -356,7 +356,7 @@ namespace Priority_Queue}//Swap the node with the last node- TItem formerLastNode = _nodes[_numNodes];+ var formerLastNode = _nodes[_numNodes];Swap(node, formerLastNode);_nodes[_numNodes] = null;_numNodes--;diff --git a/MediaBrowser.Providers/Manager/ImageSaver.cs b/MediaBrowser.Providers/Manager/ImageSaver.csindex 6160864068..d0d00ef127 100644--- a/MediaBrowser.Providers/Manager/ImageSaver.cs+++ b/MediaBrowser.Providers/Manager/ImageSaver.cs@@ -63,7 +63,7 @@ namespace MediaBrowser.Providers.Manager/// <param name="imageIndex">Index of the image.</param>/// <param name="cancellationToken">The cancellation token.</param>/// <returns>Task.</returns>- /// <exception cref="System.ArgumentNullException">mimeType</exception>+ /// <exception cref="ArgumentNullException">mimeType</exception>public Task SaveImage(BaseItem item, Stream source, string mimeType, ImageType type, int? imageIndex, CancellationToken cancellationToken){return SaveImage(item, source, mimeType, type, imageIndex, null, cancellationToken);@@ -299,7 +299,7 @@ namespace MediaBrowser.Providers.Manager/// <param name="type">The type.</param>/// <param name="imageIndex">Index of the image.</param>/// <returns>System.String.</returns>- /// <exception cref="System.ArgumentNullException">+ /// <exception cref="ArgumentNullException">/// imageIndex/// or/// imageIndex@@ -316,7 +316,7 @@ namespace MediaBrowser.Providers.Manager/// <param name="type">The type.</param>/// <param name="imageIndex">Index of the image.</param>/// <param name="path">The path.</param>- /// <exception cref="System.ArgumentNullException">imageIndex+ /// <exception cref="ArgumentNullException">imageIndex/// or/// imageIndex</exception>private void SetImagePath(BaseItem item, ImageType type, int? imageIndex, string path)@@ -333,7 +333,7 @@ namespace MediaBrowser.Providers.Manager/// <param name="mimeType">Type of the MIME.</param>/// <param name="saveLocally">if set to <c>true</c> [save locally].</param>/// <returns>System.String.</returns>- /// <exception cref="System.ArgumentNullException">+ /// <exception cref="ArgumentNullException">/// imageIndex/// or/// imageIndex@@ -490,7 +490,7 @@ namespace MediaBrowser.Providers.Manager/// <param name="imageIndex">Index of the image.</param>/// <param name="mimeType">Type of the MIME.</param>/// <returns>IEnumerable{System.String}.</returns>- /// <exception cref="System.ArgumentNullException">imageIndex</exception>+ /// <exception cref="ArgumentNullException">imageIndex</exception>private string[] GetCompatibleSavePaths(BaseItem item, ImageType type, int? imageIndex, string mimeType){var season = item as Season;diff --git a/MediaBrowser.Providers/Manager/MetadataService.cs b/MediaBrowser.Providers/Manager/MetadataService.csindex 3322582cc8..1972ad290c 100644--- a/MediaBrowser.Providers/Manager/MetadataService.cs+++ b/MediaBrowser.Providers/Manager/MetadataService.cs@@ -415,7 +415,7 @@ namespace MediaBrowser.Providers.Managervar folder = item as Folder;if (folder != null && folder.SupportsDateLastMediaAdded){- DateTime dateLastMediaAdded = DateTime.MinValue;+ var dateLastMediaAdded = DateTime.MinValue;var any = false;foreach (var child in children)diff --git a/MediaBrowser.Providers/Manager/SimplePriorityQueue.cs b/MediaBrowser.Providers/Manager/SimplePriorityQueue.csindex 9cfd5ab5cb..71e979e2c9 100644--- a/MediaBrowser.Providers/Manager/SimplePriorityQueue.cs+++ b/MediaBrowser.Providers/Manager/SimplePriorityQueue.cs@@ -80,7 +80,7 @@ namespace Priority_Queuethrow new InvalidOperationException("Cannot call .First on an empty queue");}- SimpleNode first = _queue.First;+ var first = _queue.First;return (first != null ? first.Data : default(TItem));}}@@ -155,7 +155,7 @@ namespace Priority_Queue{lock (_queue){- SimpleNode node = new SimpleNode(item);+ var node = new SimpleNode(item);if (_queue.Count == _queue.MaxSize){_queue.Resize(_queue.MaxSize * 2 + 1);@@ -199,7 +199,7 @@ namespace Priority_Queue{try{- SimpleNode updateMe = GetExistingNode(item);+ var updateMe = GetExistingNode(item);_queue.UpdatePriority(updateMe, priority);}catch (InvalidOperationException ex)@@ -211,7 +211,7 @@ namespace Priority_Queuepublic IEnumerator<TItem> GetEnumerator(){- List<TItem> queueData = new List<TItem>();+ var queueData = new List<TItem>();lock (_queue){//Copy to a separate list because we don't want to 'yield return' inside a lockdiff --git a/MediaBrowser.Providers/Movies/MovieDbProvider.cs b/MediaBrowser.Providers/Movies/MovieDbProvider.csindex ef5c781dc0..88d9a346b3 100644--- a/MediaBrowser.Providers/Movies/MovieDbProvider.cs+++ b/MediaBrowser.Providers/Movies/MovieDbProvider.cs@@ -140,7 +140,7 @@ namespace MediaBrowser.Providers.Moviesreturn _tmdbSettings;}- using (HttpResponseInfo response = await GetMovieDbResponse(new HttpRequestOptions+ using (var response = await GetMovieDbResponse(new HttpRequestOptions{Url = string.Format(TmdbConfigUrl, ApiKey),CancellationToken = cancellationToken,@@ -148,7 +148,7 @@ namespace MediaBrowser.Providers.Movies}).ConfigureAwait(false)){- using (Stream json = response.Content)+ using (var json = response.Content){_tmdbSettings = await _jsonSerializer.DeserializeFromStreamAsync<TmdbSettingsResult>(json).ConfigureAwait(false);diff --git a/MediaBrowser.Providers/Music/ArtistMetadataService.cs b/MediaBrowser.Providers/Music/ArtistMetadataService.csindex de9551f83c..5b87825542 100644--- a/MediaBrowser.Providers/Music/ArtistMetadataService.cs+++ b/MediaBrowser.Providers/Music/ArtistMetadataService.cs@@ -16,7 +16,7 @@ namespace MediaBrowser.Providers.Musicprotected override IList<BaseItem> GetChildrenForMetadataUpdates(MusicArtist item){return item.IsAccessedByName ?- item.GetTaggedItems(new Controller.Entities.InternalItemsQuery+ item.GetTaggedItems(new InternalItemsQuery{Recursive = true,IsFolder = falsediff --git a/MediaBrowser.Providers/Omdb/OmdbImageProvider.cs b/MediaBrowser.Providers/Omdb/OmdbImageProvider.csindex 8592b5c67d..4e6d223a71 100644--- a/MediaBrowser.Providers/Omdb/OmdbImageProvider.cs+++ b/MediaBrowser.Providers/Omdb/OmdbImageProvider.cs@@ -50,7 +50,7 @@ namespace MediaBrowser.Providers.Omdbif (!string.IsNullOrWhiteSpace(imdbId)){- OmdbProvider.RootObject rootObject = await provider.GetRootObject(imdbId, cancellationToken).ConfigureAwait(false);+ var rootObject = await provider.GetRootObject(imdbId, cancellationToken).ConfigureAwait(false);if (!string.IsNullOrEmpty(rootObject.Poster)){diff --git a/MediaBrowser.Providers/Omdb/OmdbProvider.cs b/MediaBrowser.Providers/Omdb/OmdbProvider.csindex c9018a42cf..618e5eb2d0 100644--- a/MediaBrowser.Providers/Omdb/OmdbProvider.cs+++ b/MediaBrowser.Providers/Omdb/OmdbProvider.cs@@ -43,7 +43,7 @@ namespace MediaBrowser.Providers.Omdbthrow new ArgumentNullException(nameof(imdbId));}- T item = itemResult.Item;+ var item = itemResult.Item;var result = await GetRootObject(imdbId, cancellationToken).ConfigureAwait(false);@@ -113,7 +113,7 @@ namespace MediaBrowser.Providers.Omdbthrow new ArgumentNullException(nameof(seriesImdbId));}- T item = itemResult.Item;+ var item = itemResult.Item;var seasonResult = await GetSeasonRootObject(seriesImdbId, seasonNumber, cancellationToken).ConfigureAwait(false);@@ -220,7 +220,7 @@ namespace MediaBrowser.Providers.Omdbstring resultString;- using (Stream stream = _fileSystem.GetFileStream(path, FileOpenMode.Open, FileAccessMode.Read, FileShareMode.Read))+ using (var stream = _fileSystem.GetFileStream(path, FileOpenMode.Open, FileAccessMode.Read, FileShareMode.Read)){using (var reader = new StreamReader(stream, new UTF8Encoding(false))){@@ -239,7 +239,7 @@ namespace MediaBrowser.Providers.Omdbstring resultString;- using (Stream stream = _fileSystem.GetFileStream(path, FileOpenMode.Open, FileAccessMode.Read, FileShareMode.Read))+ using (var stream = _fileSystem.GetFileStream(path, FileOpenMode.Open, FileAccessMode.Read, FileShareMode.Read)){using (var reader = new StreamReader(stream, new UTF8Encoding(false))){@@ -394,7 +394,7 @@ namespace MediaBrowser.Providers.Omdbprivate void ParseAdditionalMetadata<T>(MetadataResult<T> itemResult, RootObject result)where T : BaseItem{- T item = itemResult.Item;+ var item = itemResult.Item;var isConfiguredForEnglish = IsConfiguredForEnglish(item) || _configurationManager.Configuration.EnableNewOmdbSupport;diff --git a/MediaBrowser.Providers/People/MovieDbPersonProvider.cs b/MediaBrowser.Providers/People/MovieDbPersonProvider.csindex 8fc5f40f84..9d9d8fef3b 100644--- a/MediaBrowser.Providers/People/MovieDbPersonProvider.cs+++ b/MediaBrowser.Providers/People/MovieDbPersonProvider.cs@@ -265,7 +265,7 @@ namespace MediaBrowser.Providers.Peoplepublic class PersonSearchResult{/// <summary>- /// Gets or sets a value indicating whether this <see cref="MovieDbPersonProvider.PersonSearchResult" /> is adult.+ /// Gets or sets a value indicating whether this <see cref="PersonSearchResult" /> is adult./// </summary>/// <value><c>true</c> if adult; otherwise, <c>false</c>.</value>public bool Adult { get; set; }@@ -300,7 +300,7 @@ namespace MediaBrowser.Providers.People/// Gets or sets the results./// </summary>/// <value>The results.</value>- public List<MovieDbPersonProvider.PersonSearchResult> Results { get; set; }+ public List<PersonSearchResult> Results { get; set; }/// <summary>/// Gets or sets the total_ pages./// </summary>diff --git a/MediaBrowser.Providers/Playlists/PlaylistItemsProvider.cs b/MediaBrowser.Providers/Playlists/PlaylistItemsProvider.csindex 2f2d8eaeb1..89c4acf041 100644--- a/MediaBrowser.Providers/Playlists/PlaylistItemsProvider.cs+++ b/MediaBrowser.Providers/Playlists/PlaylistItemsProvider.cs@@ -131,7 +131,7 @@ namespace MediaBrowser.Providers.Playlistsprivate IEnumerable<LinkedChild> GetWplItems(Stream stream){- WplContent content = new WplContent();+ var content = new WplContent();var playlist = content.GetFromStream(stream);return playlist.PlaylistEntries.Select(i => new LinkedChilddiff --git a/MediaBrowser.Providers/Subtitles/SubtitleManager.cs b/MediaBrowser.Providers/Subtitles/SubtitleManager.csindex 0c7fe1e0fc..544cfba0d3 100644--- a/MediaBrowser.Providers/Subtitles/SubtitleManager.cs+++ b/MediaBrowser.Providers/Subtitles/SubtitleManager.cs@@ -245,7 +245,7 @@ namespace MediaBrowser.Providers.Subtitles{if (video.VideoType != VideoType.VideoFile){- return Task.FromResult<RemoteSubtitleInfo[]>(new RemoteSubtitleInfo[] { });+ return Task.FromResult(new RemoteSubtitleInfo[] { });}VideoContentType mediaType;@@ -261,7 +261,7 @@ namespace MediaBrowser.Providers.Subtitleselse{// These are the only supported types- return Task.FromResult<RemoteSubtitleInfo[]>(new RemoteSubtitleInfo[] { });+ return Task.FromResult(new RemoteSubtitleInfo[] { });}var request = new SubtitleSearchRequestdiff --git a/MediaBrowser.Providers/TV/TheTVDB/TvdbSeriesProvider.cs b/MediaBrowser.Providers/TV/TheTVDB/TvdbSeriesProvider.csindex f4fe6ee279..958312633e 100644--- a/MediaBrowser.Providers/TV/TheTVDB/TvdbSeriesProvider.cs+++ b/MediaBrowser.Providers/TV/TheTVDB/TvdbSeriesProvider.cs@@ -1118,7 +1118,7 @@ namespace MediaBrowser.Providers.TVprivate void FetchDataFromSeriesNode(MetadataResult<Series> result, XmlReader reader, CancellationToken cancellationToken){- Series item = result.Item;+ var item = result.Item;reader.MoveToContent();reader.Read();diff --git a/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs b/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.csindex 55b49d2735..3744df9b4c 100644--- a/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs+++ b/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs@@ -54,7 +54,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers/// <param name="item">The item.</param>/// <param name="metadataFile">The metadata file.</param>/// <param name="cancellationToken">The cancellation token.</param>- /// <exception cref="System.ArgumentNullException">+ /// <exception cref="ArgumentNullException">/// </exception>public void Fetch(MetadataResult<T> item, string metadataFile, CancellationToken cancellationToken){@@ -225,7 +225,7 @@ namespace MediaBrowser.XbmcMetadata.Parsersprotected void ParseProviderLinks(T item, string xml){//Look for a match for the Regex pattern "tt" followed by 7 digits- Match m = Regex.Match(xml, @"tt([0-9]{7})", RegexOptions.IgnoreCase);+ var m = Regex.Match(xml, @"tt([0-9]{7})", RegexOptions.IgnoreCase);if (m.Success){item.SetProviderId(MetadataProviders.Imdb, m.Value);@@ -379,7 +379,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers{MetadataFields field;- if (Enum.TryParse<MetadataFields>(i, true, out field))+ if (Enum.TryParse(i, true, out field)){return (MetadataFields?)field;}diff --git a/MediaBrowser.XbmcMetadata/Savers/BaseNfoSaver.cs b/MediaBrowser.XbmcMetadata/Savers/BaseNfoSaver.csindex efc6b33583..1efffff3dc 100644--- a/MediaBrowser.XbmcMetadata/Savers/BaseNfoSaver.cs+++ b/MediaBrowser.XbmcMetadata/Savers/BaseNfoSaver.cs@@ -229,7 +229,7 @@ namespace MediaBrowser.XbmcMetadata.SaversCloseOutput = false};- using (XmlWriter writer = XmlWriter.Create(stream, settings))+ using (var writer = XmlWriter.Create(stream, settings)){var root = GetRootElementName(item);diff --git a/Mono.Nat/Mapping.cs b/Mono.Nat/Mapping.csindex 4380689343..5b15d4e14f 100644--- a/Mono.Nat/Mapping.cs+++ b/Mono.Nat/Mapping.cs@@ -102,7 +102,7 @@ namespace Mono.Natpublic override bool Equals(object obj){- Mapping other = obj as Mapping;+ var other = obj as Mapping;return other == null ? false : this.protocol == other.protocol &&this.privatePort == other.privatePort && this.publicPort == other.publicPort;}diff --git a/Mono.Nat/Pmp/PmpNatDevice.cs b/Mono.Nat/Pmp/PmpNatDevice.csindex 9398e2bf9c..95bd72a6cc 100644--- a/Mono.Nat/Pmp/PmpNatDevice.cs+++ b/Mono.Nat/Pmp/PmpNatDevice.cs@@ -66,7 +66,7 @@ namespace Mono.Nat.Pmppublic override bool Equals(object obj){- PmpNatDevice device = obj as PmpNatDevice;+ var device = obj as PmpNatDevice;return (device == null) ? false : this.Equals(device);}diff --git a/Mono.Nat/Pmp/PmpSearcher.cs b/Mono.Nat/Pmp/PmpSearcher.csindex 5e41558419..cbd0d36860 100644--- a/Mono.Nat/Pmp/PmpSearcher.cs+++ b/Mono.Nat/Pmp/PmpSearcher.cs@@ -81,14 +81,14 @@ namespace Mono.Nattry{- foreach (NetworkInterface n in NetworkInterface.GetAllNetworkInterfaces())+ foreach (var n in NetworkInterface.GetAllNetworkInterfaces()){if (n.OperationalStatus != OperationalStatus.Up && n.OperationalStatus != OperationalStatus.Unknown)continue;- IPInterfaceProperties properties = n.GetIPProperties();- List<IPEndPoint> gatewayList = new List<IPEndPoint>();+ var properties = n.GetIPProperties();+ var gatewayList = new List<IPEndPoint>();- foreach (GatewayIPAddressInformation gateway in properties.GatewayAddresses)+ foreach (var gateway in properties.GatewayAddresses){if (gateway.Address.AddressFamily == AddressFamily.InterNetwork){@@ -120,7 +120,7 @@ namespace Mono.Natif (gatewayList.Count > 0){- foreach (UnicastIPAddressInformation address in properties.UnicastAddresses)+ foreach (var address in properties.UnicastAddresses){if (address.Address.AddressFamily == AddressFamily.InterNetwork){@@ -150,7 +150,7 @@ namespace Mono.Natpublic async void Search(){- foreach (UdpClient s in sockets)+ foreach (var s in sockets){try{@@ -181,7 +181,7 @@ namespace Mono.Nat// The nat-pmp search message. Must be sent to GatewayIP:53531byte[] buffer = new byte[] { PmpConstants.Version, PmpConstants.OperationCode };- foreach (IPEndPoint gatewayEndpoint in gatewayLists[client])+ foreach (var gatewayEndpoint in gatewayLists[client]){await client.SendAsync(buffer, buffer.Length, gatewayEndpoint).ConfigureAwait(false);}@@ -189,8 +189,8 @@ namespace Mono.Natbool IsSearchAddress(IPAddress address){- foreach (List<IPEndPoint> gatewayList in gatewayLists.Values)- foreach (IPEndPoint gatewayEndpoint in gatewayList)+ foreach (var gatewayList in gatewayLists.Values)+ foreach (var gatewayEndpoint in gatewayList)if (gatewayEndpoint.Address.Equals(address))return true;return false;@@ -210,7 +210,7 @@ namespace Mono.Natif (errorcode != 0)_logger.LogDebug("Non zero error: {0}", errorcode);- IPAddress publicIp = new IPAddress(new byte[] { response[8], response[9], response[10], response[11] });+ var publicIp = new IPAddress(new byte[] { response[8], response[9], response[10], response[11] });nextSearch = DateTime.Now.AddMinutes(5);timeout = 250;diff --git a/Mono.Nat/Upnp/Messages/Requests/CreatePortMappingMessage.cs b/Mono.Nat/Upnp/Messages/Requests/CreatePortMappingMessage.csindex 5a2ab009aa..217095e492 100644--- a/Mono.Nat/Upnp/Messages/Requests/CreatePortMappingMessage.cs+++ b/Mono.Nat/Upnp/Messages/Requests/CreatePortMappingMessage.cs@@ -54,10 +54,10 @@ namespace Mono.Nat.Upnppublic override HttpRequestOptions Encode(){- CultureInfo culture = CultureInfo.InvariantCulture;+ var culture = CultureInfo.InvariantCulture;- StringBuilder builder = new StringBuilder(256);- XmlWriter writer = CreateWriter(builder);+ var builder = new StringBuilder(256);+ var writer = CreateWriter(builder);WriteFullElement(writer, "NewRemoteHost", string.Empty);WriteFullElement(writer, "NewExternalPort", this.mapping.PublicPort.ToString(culture));diff --git a/Mono.Nat/Upnp/Messages/UpnpMessage.cs b/Mono.Nat/Upnp/Messages/UpnpMessage.csindex e734db8f4d..1151dd997d 100644--- a/Mono.Nat/Upnp/Messages/UpnpMessage.cs+++ b/Mono.Nat/Upnp/Messages/UpnpMessage.cs@@ -91,7 +91,7 @@ namespace Mono.Nat.Upnpprotected XmlWriter CreateWriter(StringBuilder sb){- XmlWriterSettings settings = new XmlWriterSettings();+ var settings = new XmlWriterSettings();settings.ConformanceLevel = ConformanceLevel.Fragment;return XmlWriter.Create(sb, settings);}diff --git a/Mono.Nat/Upnp/Searchers/UpnpSearcher.cs b/Mono.Nat/Upnp/Searchers/UpnpSearcher.csindex 57ecdeca9b..b70768b6ff 100644--- a/Mono.Nat/Upnp/Searchers/UpnpSearcher.cs+++ b/Mono.Nat/Upnp/Searchers/UpnpSearcher.cs@@ -82,7 +82,7 @@ namespace Mono.Nat* prefix. */// We have an internet gateway device now- UpnpNatDevice d = new UpnpNatDevice(localAddress, deviceInfo, endpoint, string.Empty, _logger, _httpClient);+ var d = new UpnpNatDevice(localAddress, deviceInfo, endpoint, string.Empty, _logger, _httpClient);await d.GetServicesList().ConfigureAwait(false);diff --git a/Mono.Nat/Upnp/UpnpNatDevice.cs b/Mono.Nat/Upnp/UpnpNatDevice.csindex f37d6dd0c7..63a28ebdc0 100644--- a/Mono.Nat/Upnp/UpnpNatDevice.cs+++ b/Mono.Nat/Upnp/UpnpNatDevice.cs@@ -109,8 +109,8 @@ namespace Mono.Nat.Upnpint abortCount = 0;int bytesRead = 0;byte[] buffer = new byte[10240];- StringBuilder servicesXml = new StringBuilder();- XmlDocument xmldoc = new XmlDocument();+ var servicesXml = new StringBuilder();+ var xmldoc = new XmlDocument();using (var s = response.Content){@@ -144,9 +144,9 @@ namespace Mono.Nat.Upnp}}- XmlNamespaceManager ns = new XmlNamespaceManager(xmldoc.NameTable);+ var ns = new XmlNamespaceManager(xmldoc.NameTable);ns.AddNamespace("ns", "urn:schemas-upnp-org:device-1-0");- XmlNodeList nodes = xmldoc.SelectNodes("//*/ns:serviceList", ns);+ var nodes = xmldoc.SelectNodes("//*/ns:serviceList", ns);foreach (XmlNode node in nodes){@@ -169,7 +169,7 @@ namespace Mono.Nat.Upnp{if (u.IsAbsoluteUri){- EndPoint old = hostEndPoint;+ var old = hostEndPoint;IPAddress parsedHostIpAddress;if (IPAddress.TryParse(u.Host, out parsedHostIpAddress)){@@ -228,7 +228,7 @@ namespace Mono.Nat.Upnppublic override async Task CreatePortMap(Mapping mapping){- CreatePortMappingMessage message = new CreatePortMappingMessage(mapping, localAddress, this);+ var message = new CreatePortMappingMessage(mapping, localAddress, this);using (await _httpClient.SendAsync(message.Encode(), message.Method).ConfigureAwait(false)){@@ -237,7 +237,7 @@ namespace Mono.Nat.Upnppublic override bool Equals(object obj){- UpnpNatDevice device = obj as UpnpNatDevice;+ var device = obj as UpnpNatDevice;return (device == null) ? false : this.Equals((device));}diff --git a/OpenSubtitlesHandler/Console/OSHConsole.cs b/OpenSubtitlesHandler/Console/OSHConsole.csindex 586377e53e..396b28cbc6 100644--- a/OpenSubtitlesHandler/Console/OSHConsole.cs+++ b/OpenSubtitlesHandler/Console/OSHConsole.cs@@ -58,7 +58,7 @@ namespace OpenSubtitlesHandler.Console/// <summary>/// Console Debug Args/// </summary>- public class DebugEventArgs : System.EventArgs+ public class DebugEventArgs : EventArgs{public DebugCode Code { get; private set; }public string Text { get; private set; }diff --git a/OpenSubtitlesHandler/MovieHasher.cs b/OpenSubtitlesHandler/MovieHasher.csindex 5a93edd5cf..25d91c1aca 100644--- a/OpenSubtitlesHandler/MovieHasher.cs+++ b/OpenSubtitlesHandler/MovieHasher.cs@@ -37,7 +37,7 @@ namespace OpenSubtitlesHandlerpublic static string ToHexadecimal(byte[] bytes){- StringBuilder hexBuilder = new StringBuilder();+ var hexBuilder = new StringBuilder();for (int i = 0; i < bytes.Length; i++){hexBuilder.Append(bytes[i].ToString("x2"));diff --git a/OpenSubtitlesHandler/OpenSubtitles.cs b/OpenSubtitlesHandler/OpenSubtitles.csindex 4a44ccde3b..ddf2e83e8c 100644--- a/OpenSubtitlesHandler/OpenSubtitles.cs+++ b/OpenSubtitlesHandler/OpenSubtitles.cs@@ -57,12 +57,12 @@ namespace OpenSubtitlesHandlerpublic static IMethodResponse LogIn(string userName, string password, string language){// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();parms.Add(new XmlRpcValueBasic(userName));parms.Add(new XmlRpcValueBasic(password));parms.Add(new XmlRpcValueBasic(language));parms.Add(new XmlRpcValueBasic(XML_PRC_USERAGENT));- XmlRpcMethodCall call = new XmlRpcMethodCall("LogIn", parms);+ var call = new XmlRpcMethodCall("LogIn", parms);OSHConsole.WriteLine("Sending LogIn request to the server ...", DebugCode.Good);//File.WriteAllText(".\\request.txt", Encoding.UTF8.GetString(XmlRpcGenerator.Generate(call)));@@ -77,9 +77,9 @@ namespace OpenSubtitlesHandler{if (calls[0].Parameters.Count > 0){- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];- MethodResponseLogIn re = new MethodResponseLogIn("Success", "Log in successful.");- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var re = new MethodResponseLogIn("Success", "Log in successful.");+ foreach (var MEMBER in mainStruct.Members){switch (MEMBER.Name){@@ -103,12 +103,12 @@ namespace OpenSubtitlesHandlerpublic static async Task<IMethodResponse> LogInAsync(string userName, string password, string language, CancellationToken cancellationToken){// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();parms.Add(new XmlRpcValueBasic(userName));parms.Add(new XmlRpcValueBasic(password));parms.Add(new XmlRpcValueBasic(language));parms.Add(new XmlRpcValueBasic(XML_PRC_USERAGENT));- XmlRpcMethodCall call = new XmlRpcMethodCall("LogIn", parms);+ var call = new XmlRpcMethodCall("LogIn", parms);OSHConsole.WriteLine("Sending LogIn request to the server ...", DebugCode.Good);//File.WriteAllText(".\\request.txt", Encoding.UTF8.GetString(XmlRpcGenerator.Generate(call)));@@ -126,9 +126,9 @@ namespace OpenSubtitlesHandler{if (calls[0].Parameters.Count > 0){- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];- MethodResponseLogIn re = new MethodResponseLogIn("Success", "Log in successful.");- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var re = new MethodResponseLogIn("Success", "Log in successful.");+ foreach (var MEMBER in mainStruct.Members){switch (MEMBER.Name){@@ -170,9 +170,9 @@ namespace OpenSubtitlesHandlerreturn new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");}// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));- XmlRpcMethodCall call = new XmlRpcMethodCall("LogOut", parms);+ var call = new XmlRpcMethodCall("LogOut", parms);OSHConsole.WriteLine("Sending LogOut request to the server ...", DebugCode.Good);// Send the request to the server@@ -185,10 +185,10 @@ namespace OpenSubtitlesHandler{if (calls[0].Parameters.Count > 0){- XmlRpcValueStruct strct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var strct = (XmlRpcValueStruct)calls[0].Parameters[0];OSHConsole.WriteLine("STATUS=" + ((XmlRpcValueBasic)strct.Members[0].Data).Data.ToString());OSHConsole.WriteLine("SECONDS=" + ((XmlRpcValueBasic)strct.Members[1].Data).Data.ToString());- MethodResponseLogIn re = new MethodResponseLogIn("Success", "Log out successful.");+ var re = new MethodResponseLogIn("Success", "Log out successful.");re.Status = ((XmlRpcValueBasic)strct.Members[0].Data).Data.ToString();re.Seconds = (double)((XmlRpcValueBasic)strct.Members[1].Data).Data;return re;@@ -214,10 +214,10 @@ namespace OpenSubtitlesHandlerreturn new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");}// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));parms.Add(new XmlRpcValueBasic(XML_PRC_USERAGENT, XmlRpcBasicValueType.String));- XmlRpcMethodCall call = new XmlRpcMethodCall("NoOperation", parms);+ var call = new XmlRpcMethodCall("NoOperation", parms);OSHConsole.WriteLine("Sending NoOperation request to the server ...", DebugCode.Good);// Send the request to the server@@ -230,18 +230,18 @@ namespace OpenSubtitlesHandler{if (calls[0].Parameters.Count > 0){- MethodResponseNoOperation R = new MethodResponseNoOperation();- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var R = new MethodResponseNoOperation();+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];// To make sure response is not currepted by server, do it in loop- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ foreach (var MEMBER in mainStruct.Members){switch (MEMBER.Name){case "status": R.Status = (string)MEMBER.Data.Data; OSHConsole.WriteLine(MEMBER.Name + "= " + MEMBER.Data.Data); break;case "seconds": R.Seconds = (double)MEMBER.Data.Data; OSHConsole.WriteLine(MEMBER.Name + "= " + MEMBER.Data.Data); break;case "download_limits":- XmlRpcValueStruct dlStruct = (XmlRpcValueStruct)MEMBER.Data;- foreach (XmlRpcStructMember dlmember in dlStruct.Members)+ var dlStruct = (XmlRpcValueStruct)MEMBER.Data;+ foreach (var dlmember in dlStruct.Members){OSHConsole.WriteLine(" >" + dlmember.Name + "= " + dlmember.Data.Data.ToString());switch (dlmember.Name)@@ -292,16 +292,16 @@ namespace OpenSubtitlesHandlerreturn new MethodResponseError("Fail", "No subtitle search parameter passed");}// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();// Add token paramparms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));// Add subtitle search parameters. Each one will be like 'array' of structs.- XmlRpcValueArray array = new XmlRpcValueArray();- foreach (SubtitleSearchParameters param in parameters)+ var array = new XmlRpcValueArray();+ foreach (var param in parameters){- XmlRpcValueStruct strct = new XmlRpcValueStruct(new List<XmlRpcStructMember>());+ var strct = new XmlRpcValueStruct(new List<XmlRpcStructMember>());// sublanguageid member- XmlRpcStructMember member = new XmlRpcStructMember("sublanguageid",+ var member = new XmlRpcStructMember("sublanguageid",new XmlRpcValueBasic(param.SubLangaugeID, XmlRpcBasicValueType.String));strct.Members.Add(member);// moviehash member@@ -345,7 +345,7 @@ namespace OpenSubtitlesHandler// Add the array to the parametersparms.Add(array);// Call !- XmlRpcMethodCall call = new XmlRpcMethodCall("SearchSubtitles", parms);+ var call = new XmlRpcMethodCall("SearchSubtitles", parms);OSHConsole.WriteLine("Sending SearchSubtitles request to the server ...", DebugCode.Good);// Send the request to the serverstring response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));@@ -362,11 +362,11 @@ namespace OpenSubtitlesHandler//* the first is status//* the second is [array of structs, each one includes subtitle file].//* the third is [double basic value] represent seconds token by server.- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];// Create the response, we'll need it later- MethodResponseSubtitleSearch R = new MethodResponseSubtitleSearch();+ var R = new MethodResponseSubtitleSearch();// To make sure response is not currepted by server, do it in loop- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ foreach (var MEMBER in mainStruct.Members){if (MEMBER.Name == "status"){@@ -384,14 +384,14 @@ namespace OpenSubtitlesHandler{OSHConsole.WriteLine("Search results: ");- XmlRpcValueArray rarray = (XmlRpcValueArray)MEMBER.Data;- foreach (IXmlRpcValue subStruct in rarray.Values)+ var rarray = (XmlRpcValueArray)MEMBER.Data;+ foreach (var subStruct in rarray.Values){if (subStruct == null) continue;if (!(subStruct is XmlRpcValueStruct)) continue;- SubtitleSearchResult result = new SubtitleSearchResult();- foreach (XmlRpcStructMember submember in ((XmlRpcValueStruct)subStruct).Members)+ var result = new SubtitleSearchResult();+ foreach (var submember in ((XmlRpcValueStruct)subStruct).Members){// To avoid errors of arranged info or missing ones, let's do it with switch..switch (submember.Name)@@ -472,16 +472,16 @@ namespace OpenSubtitlesHandlerreturn new MethodResponseError("Fail", "No subtitle search parameter passed");}// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();// Add token paramparms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));// Add subtitle search parameters. Each one will be like 'array' of structs.- XmlRpcValueArray array = new XmlRpcValueArray();- foreach (SubtitleSearchParameters param in parameters)+ var array = new XmlRpcValueArray();+ foreach (var param in parameters){- XmlRpcValueStruct strct = new XmlRpcValueStruct(new List<XmlRpcStructMember>());+ var strct = new XmlRpcValueStruct(new List<XmlRpcStructMember>());// sublanguageid member- XmlRpcStructMember member = new XmlRpcStructMember("sublanguageid",+ var member = new XmlRpcStructMember("sublanguageid",new XmlRpcValueBasic(param.SubLangaugeID, XmlRpcBasicValueType.String));strct.Members.Add(member);// moviehash member@@ -525,7 +525,7 @@ namespace OpenSubtitlesHandler// Add the array to the parametersparms.Add(array);// Call !- XmlRpcMethodCall call = new XmlRpcMethodCall("SearchSubtitles", parms);+ var call = new XmlRpcMethodCall("SearchSubtitles", parms);OSHConsole.WriteLine("Sending SearchSubtitles request to the server ...", DebugCode.Good);// Send the request to the serverstring response = Utilities.GetStreamString(await Utilities.SendRequestAsync(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT, cancellationToken).ConfigureAwait(false));@@ -542,11 +542,11 @@ namespace OpenSubtitlesHandler//* the first is status//* the second is [array of structs, each one includes subtitle file].//* the third is [double basic value] represent seconds token by server.- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];// Create the response, we'll need it later- MethodResponseSubtitleSearch R = new MethodResponseSubtitleSearch();+ var R = new MethodResponseSubtitleSearch();// To make sure response is not currepted by server, do it in loop- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ foreach (var MEMBER in mainStruct.Members){if (MEMBER.Name == "status"){@@ -564,14 +564,14 @@ namespace OpenSubtitlesHandler{OSHConsole.WriteLine("Search results: ");- XmlRpcValueArray rarray = (XmlRpcValueArray)MEMBER.Data;- foreach (IXmlRpcValue subStruct in rarray.Values)+ var rarray = (XmlRpcValueArray)MEMBER.Data;+ foreach (var subStruct in rarray.Values){if (subStruct == null) continue;if (!(subStruct is XmlRpcValueStruct)) continue;- SubtitleSearchResult result = new SubtitleSearchResult();- foreach (XmlRpcStructMember submember in ((XmlRpcValueStruct)subStruct).Members)+ var result = new SubtitleSearchResult();+ foreach (var submember in ((XmlRpcValueStruct)subStruct).Members){// To avoid errors of arranged info or missing ones, let's do it with switch..switch (submember.Name)@@ -657,11 +657,11 @@ namespace OpenSubtitlesHandlerreturn new MethodResponseError("Fail", "No subtitle id passed");}// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();// Add token paramparms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));// Add subtitle search parameters. Each one will be like 'array' of structs.- XmlRpcValueArray array = new XmlRpcValueArray();+ var array = new XmlRpcValueArray();foreach (int id in subIDS){array.Values.Add(new XmlRpcValueBasic(id, XmlRpcBasicValueType.Int));@@ -669,7 +669,7 @@ namespace OpenSubtitlesHandler// Add the array to the parametersparms.Add(array);// Call !- XmlRpcMethodCall call = new XmlRpcMethodCall("DownloadSubtitles", parms);+ var call = new XmlRpcMethodCall("DownloadSubtitles", parms);OSHConsole.WriteLine("Sending DownloadSubtitles request to the server ...", DebugCode.Good);// Send the request to the serverstring response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));@@ -685,12 +685,12 @@ namespace OpenSubtitlesHandler//* the first is status//* the second is [array of structs, each one includes subtitle file].//* the third is [double basic value] represent seconds token by server.- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];// Create the response, we'll need it later- MethodResponseSubtitleDownload R = new MethodResponseSubtitleDownload();+ var R = new MethodResponseSubtitleDownload();// To make sure response is not currepted by server, do it in loop- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ foreach (var MEMBER in mainStruct.Members){if (MEMBER.Name == "status"){@@ -707,14 +707,14 @@ namespace OpenSubtitlesHandlerif (MEMBER.Data is XmlRpcValueArray){OSHConsole.WriteLine("Download results:");- XmlRpcValueArray rarray = (XmlRpcValueArray)MEMBER.Data;- foreach (IXmlRpcValue subStruct in rarray.Values)+ var rarray = (XmlRpcValueArray)MEMBER.Data;+ foreach (var subStruct in rarray.Values){if (subStruct == null) continue;if (!(subStruct is XmlRpcValueStruct)) continue;- SubtitleDownloadResult result = new SubtitleDownloadResult();- foreach (XmlRpcStructMember submember in ((XmlRpcValueStruct)subStruct).Members)+ var result = new SubtitleDownloadResult();+ foreach (var submember in ((XmlRpcValueStruct)subStruct).Members){// To avoid errors of arranged info or missing ones, let's do it with switch..switch (submember.Name)@@ -764,11 +764,11 @@ namespace OpenSubtitlesHandlerreturn new MethodResponseError("Fail", "No subtitle id passed");}// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();// Add token paramparms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));// Add subtitle search parameters. Each one will be like 'array' of structs.- XmlRpcValueArray array = new XmlRpcValueArray();+ var array = new XmlRpcValueArray();foreach (int id in subIDS){array.Values.Add(new XmlRpcValueBasic(id, XmlRpcBasicValueType.Int));@@ -776,7 +776,7 @@ namespace OpenSubtitlesHandler// Add the array to the parametersparms.Add(array);// Call !- XmlRpcMethodCall call = new XmlRpcMethodCall("DownloadSubtitles", parms);+ var call = new XmlRpcMethodCall("DownloadSubtitles", parms);OSHConsole.WriteLine("Sending DownloadSubtitles request to the server ...", DebugCode.Good);// Send the request to the server@@ -795,12 +795,12 @@ namespace OpenSubtitlesHandler//* the first is status//* the second is [array of structs, each one includes subtitle file].//* the third is [double basic value] represent seconds token by server.- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];// Create the response, we'll need it later- MethodResponseSubtitleDownload R = new MethodResponseSubtitleDownload();+ var R = new MethodResponseSubtitleDownload();// To make sure response is not currepted by server, do it in loop- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ foreach (var MEMBER in mainStruct.Members){if (MEMBER.Name == "status"){@@ -817,14 +817,14 @@ namespace OpenSubtitlesHandlerif (MEMBER.Data is XmlRpcValueArray){OSHConsole.WriteLine("Download results:");- XmlRpcValueArray rarray = (XmlRpcValueArray)MEMBER.Data;- foreach (IXmlRpcValue subStruct in rarray.Values)+ var rarray = (XmlRpcValueArray)MEMBER.Data;+ foreach (var subStruct in rarray.Values){if (subStruct == null) continue;if (!(subStruct is XmlRpcValueStruct)) continue;- SubtitleDownloadResult result = new SubtitleDownloadResult();- foreach (XmlRpcStructMember submember in ((XmlRpcValueStruct)subStruct).Members)+ var result = new SubtitleDownloadResult();+ foreach (var submember in ((XmlRpcValueStruct)subStruct).Members){// To avoid errors of arranged info or missing ones, let's do it with switch..switch (submember.Name)@@ -879,15 +879,15 @@ namespace OpenSubtitlesHandlerreturn new MethodResponseError("Fail", "No subtitle id passed");}// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();// Add token paramparms.Add(new XmlRpcValueBasic(TOKEN));// Add subtitle search parameters. Each one will be like 'array' of structs.- XmlRpcValueArray array = new XmlRpcValueArray(subIDS);+ var array = new XmlRpcValueArray(subIDS);// Add the array to the parametersparms.Add(array);// Call !- XmlRpcMethodCall call = new XmlRpcMethodCall("GetComments", parms);+ var call = new XmlRpcMethodCall("GetComments", parms);OSHConsole.WriteLine("Sending GetComments request to the server ...", DebugCode.Good);// Send the request to the serverstring response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));@@ -899,12 +899,12 @@ namespace OpenSubtitlesHandler{if (calls[0].Parameters.Count > 0){- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];// Create the response, we'll need it later- MethodResponseGetComments R = new MethodResponseGetComments();+ var R = new MethodResponseGetComments();// To make sure response is not currepted by server, do it in loop- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ foreach (var MEMBER in mainStruct.Members){if (MEMBER.Name == "status"){@@ -921,14 +921,14 @@ namespace OpenSubtitlesHandlerif (MEMBER.Data is XmlRpcValueArray){OSHConsole.WriteLine("Comments results:");- XmlRpcValueArray rarray = (XmlRpcValueArray)MEMBER.Data;- foreach (IXmlRpcValue commentStruct in rarray.Values)+ var rarray = (XmlRpcValueArray)MEMBER.Data;+ foreach (var commentStruct in rarray.Values){if (commentStruct == null) continue;if (!(commentStruct is XmlRpcValueStruct)) continue;- GetCommentsResult result = new GetCommentsResult();- foreach (XmlRpcStructMember commentmember in ((XmlRpcValueStruct)commentStruct).Members)+ var result = new GetCommentsResult();+ foreach (var commentmember in ((XmlRpcValueStruct)commentStruct).Members){// To avoid errors of arranged info or missing ones, let's do it with switch..switch (commentmember.Name)@@ -977,22 +977,22 @@ namespace OpenSubtitlesHandlerreturn new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");}// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));// Array of sub langs- XmlRpcValueArray a = new XmlRpcValueArray(languageIDS);+ var a = new XmlRpcValueArray(languageIDS);parms.Add(a);// Array of video parametersa = new XmlRpcValueArray();- foreach (SearchToMailMovieParameter p in movies)+ foreach (var p in movies){- XmlRpcValueStruct str = new XmlRpcValueStruct(new List<XmlRpcStructMember>());+ var str = new XmlRpcValueStruct(new List<XmlRpcStructMember>());str.Members.Add(new XmlRpcStructMember("moviehash", new XmlRpcValueBasic(p.moviehash)));str.Members.Add(new XmlRpcStructMember("moviesize", new XmlRpcValueBasic(p.moviesize)));a.Values.Add(str);}parms.Add(a);- XmlRpcMethodCall call = new XmlRpcMethodCall("SearchToMail", parms);+ var call = new XmlRpcMethodCall("SearchToMail", parms);OSHConsole.WriteLine("Sending SearchToMail request to the server ...", DebugCode.Good);// Send the request to the server@@ -1005,12 +1005,12 @@ namespace OpenSubtitlesHandler{if (calls[0].Parameters.Count > 0){- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];// Create the response, we'll need it later- MethodResponseSearchToMail R = new MethodResponseSearchToMail();+ var R = new MethodResponseSearchToMail();// To make sure response is not currepted by server, do it in loop- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ foreach (var MEMBER in mainStruct.Members){switch (MEMBER.Name){@@ -1044,13 +1044,13 @@ namespace OpenSubtitlesHandlerreturn new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");}// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();// Add token paramparms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));// Add query paramparms.Add(new XmlRpcValueBasic(query, XmlRpcBasicValueType.String));// Call !- XmlRpcMethodCall call = new XmlRpcMethodCall("SearchMoviesOnIMDB", parms);+ var call = new XmlRpcMethodCall("SearchMoviesOnIMDB", parms);OSHConsole.WriteLine("Sending SearchMoviesOnIMDB request to the server ...", DebugCode.Good);// Send the request to the serverstring response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));@@ -1062,12 +1062,12 @@ namespace OpenSubtitlesHandler{if (calls[0].Parameters.Count > 0){- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];// Create the response, we'll need it later- MethodResponseMovieSearch R = new MethodResponseMovieSearch();+ var R = new MethodResponseMovieSearch();// To make sure response is not currepted by server, do it in loop- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ foreach (var MEMBER in mainStruct.Members){if (MEMBER.Name == "status"){@@ -1084,14 +1084,14 @@ namespace OpenSubtitlesHandlerif (MEMBER.Data is XmlRpcValueArray){OSHConsole.WriteLine("Search results:");- XmlRpcValueArray rarray = (XmlRpcValueArray)MEMBER.Data;- foreach (IXmlRpcValue subStruct in rarray.Values)+ var rarray = (XmlRpcValueArray)MEMBER.Data;+ foreach (var subStruct in rarray.Values){if (subStruct == null) continue;if (!(subStruct is XmlRpcValueStruct)) continue;- MovieSearchResult result = new MovieSearchResult();- foreach (XmlRpcStructMember submember in ((XmlRpcValueStruct)subStruct).Members)+ var result = new MovieSearchResult();+ foreach (var submember in ((XmlRpcValueStruct)subStruct).Members){// To avoid errors of arranged info or missing ones, let's do it with switch..switch (submember.Name)@@ -1135,13 +1135,13 @@ namespace OpenSubtitlesHandlerreturn new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");}// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();// Add token paramparms.Add(new XmlRpcValueBasic(TOKEN));// Add query paramparms.Add(new XmlRpcValueBasic(imdbid));// Call !- XmlRpcMethodCall call = new XmlRpcMethodCall("GetIMDBMovieDetails", parms);+ var call = new XmlRpcMethodCall("GetIMDBMovieDetails", parms);OSHConsole.WriteLine("Sending GetIMDBMovieDetails request to the server ...", DebugCode.Good);// Send the request to the serverstring response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));@@ -1153,12 +1153,12 @@ namespace OpenSubtitlesHandler{if (calls[0].Parameters.Count > 0){- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];// Create the response, we'll need it later- MethodResponseMovieDetails R = new MethodResponseMovieDetails();+ var R = new MethodResponseMovieDetails();// To make sure response is not currepted by server, do it in loop- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ foreach (var MEMBER in mainStruct.Members){if (MEMBER.Name == "status"){@@ -1176,8 +1176,8 @@ namespace OpenSubtitlesHandlerif (MEMBER.Data is XmlRpcValueStruct){OSHConsole.WriteLine("Details result:");- XmlRpcValueStruct detailsStruct = (XmlRpcValueStruct)MEMBER.Data;- foreach (XmlRpcStructMember dmem in detailsStruct.Members)+ var detailsStruct = (XmlRpcValueStruct)MEMBER.Data;+ foreach (var dmem in detailsStruct.Members){switch (dmem.Name){@@ -1193,8 +1193,8 @@ namespace OpenSubtitlesHandlercase "cast":// this is another struct with cast members...OSHConsole.WriteLine(">" + dmem.Name + "= ");- XmlRpcValueStruct castStruct = (XmlRpcValueStruct)dmem.Data;- foreach (XmlRpcStructMember castMemeber in castStruct.Members)+ var castStruct = (XmlRpcValueStruct)dmem.Data;+ foreach (var castMemeber in castStruct.Members){R.Cast.Add(castMemeber.Data.Data.ToString());OSHConsole.WriteLine(" >" + castMemeber.Data.Data.ToString());@@ -1203,8 +1203,8 @@ namespace OpenSubtitlesHandlercase "directors":OSHConsole.WriteLine(">" + dmem.Name + "= ");// this is another struct with directors members...- XmlRpcValueStruct directorsStruct = (XmlRpcValueStruct)dmem.Data;- foreach (XmlRpcStructMember directorsMember in directorsStruct.Members)+ var directorsStruct = (XmlRpcValueStruct)dmem.Data;+ foreach (var directorsMember in directorsStruct.Members){R.Directors.Add(directorsMember.Data.Data.ToString());OSHConsole.WriteLine(" >" + directorsMember.Data.Data.ToString());@@ -1213,8 +1213,8 @@ namespace OpenSubtitlesHandlercase "writers":OSHConsole.WriteLine(">" + dmem.Name + "= ");// this is another struct with writers members...- XmlRpcValueStruct writersStruct = (XmlRpcValueStruct)dmem.Data;- foreach (XmlRpcStructMember writersMember in writersStruct.Members)+ var writersStruct = (XmlRpcValueStruct)dmem.Data;+ foreach (var writersMember in writersStruct.Members){R.Writers.Add(writersMember.Data.Data.ToString());OSHConsole.WriteLine("+->" + writersMember.Data.Data.ToString());@@ -1222,7 +1222,7 @@ namespace OpenSubtitlesHandlerbreak;case "awards":// this is an array of genres...- XmlRpcValueArray awardsArray = (XmlRpcValueArray)dmem.Data;+ var awardsArray = (XmlRpcValueArray)dmem.Data;foreach (XmlRpcValueBasic award in awardsArray.Values){R.Awards.Add(award.Data.ToString());@@ -1232,7 +1232,7 @@ namespace OpenSubtitlesHandlercase "genres":OSHConsole.WriteLine(">" + dmem.Name + "= ");// this is an array of genres...- XmlRpcValueArray genresArray = (XmlRpcValueArray)dmem.Data;+ var genresArray = (XmlRpcValueArray)dmem.Data;foreach (XmlRpcValueBasic genre in genresArray.Values){R.Genres.Add(genre.Data.ToString());@@ -1242,7 +1242,7 @@ namespace OpenSubtitlesHandlercase "country":OSHConsole.WriteLine(">" + dmem.Name + "= ");// this is an array of country...- XmlRpcValueArray countryArray = (XmlRpcValueArray)dmem.Data;+ var countryArray = (XmlRpcValueArray)dmem.Data;foreach (XmlRpcValueBasic country in countryArray.Values){R.Country.Add(country.Data.ToString());@@ -1252,7 +1252,7 @@ namespace OpenSubtitlesHandlercase "language":OSHConsole.WriteLine(">" + dmem.Name + "= ");// this is an array of language...- XmlRpcValueArray languageArray = (XmlRpcValueArray)dmem.Data;+ var languageArray = (XmlRpcValueArray)dmem.Data;foreach (XmlRpcValueBasic language in languageArray.Values){R.Language.Add(language.Data.ToString());@@ -1262,7 +1262,7 @@ namespace OpenSubtitlesHandlercase "certification":OSHConsole.WriteLine(">" + dmem.Name + "= ");// this is an array of certification...- XmlRpcValueArray certificationArray = (XmlRpcValueArray)dmem.Data;+ var certificationArray = (XmlRpcValueArray)dmem.Data;foreach (XmlRpcValueBasic certification in certificationArray.Values){R.Certification.Add(certification.Data.ToString());@@ -1304,16 +1304,16 @@ namespace OpenSubtitlesHandlerreturn new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");}// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();// Add token paramparms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));// Add movieinfo struct- XmlRpcValueStruct movieinfo = new XmlRpcValueStruct(new List<XmlRpcStructMember>());+ var movieinfo = new XmlRpcValueStruct(new List<XmlRpcStructMember>());movieinfo.Members.Add(new XmlRpcStructMember("moviename", new XmlRpcValueBasic(movieName)));movieinfo.Members.Add(new XmlRpcStructMember("movieyear", new XmlRpcValueBasic(movieyear)));parms.Add(movieinfo);// Call !- XmlRpcMethodCall call = new XmlRpcMethodCall("InsertMovie", parms);+ var call = new XmlRpcMethodCall("InsertMovie", parms);OSHConsole.WriteLine("Sending InsertMovie request to the server ...", DebugCode.Good);// Send the request to the serverstring response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));@@ -1325,12 +1325,12 @@ namespace OpenSubtitlesHandler{if (calls[0].Parameters.Count > 0){- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];// Create the response, we'll need it later- MethodResponseInsertMovie R = new MethodResponseInsertMovie();+ var R = new MethodResponseInsertMovie();// To make sure response is not currepted by server, do it in loop- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ foreach (var MEMBER in mainStruct.Members){if (MEMBER.Name == "status"){@@ -1373,11 +1373,11 @@ namespace OpenSubtitlesHandlerreturn new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");}// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));- foreach (InsertMovieHashParameters p in parameters)+ foreach (var p in parameters){- XmlRpcValueStruct pstruct = new XmlRpcValueStruct(new List<XmlRpcStructMember>());+ var pstruct = new XmlRpcValueStruct(new List<XmlRpcStructMember>());pstruct.Members.Add(new XmlRpcStructMember("moviehash", new XmlRpcValueBasic(p.moviehash)));pstruct.Members.Add(new XmlRpcStructMember("moviebytesize", new XmlRpcValueBasic(p.moviebytesize)));pstruct.Members.Add(new XmlRpcStructMember("imdbid", new XmlRpcValueBasic(p.imdbid)));@@ -1386,7 +1386,7 @@ namespace OpenSubtitlesHandlerpstruct.Members.Add(new XmlRpcStructMember("moviefilename", new XmlRpcValueBasic(p.moviefilename)));parms.Add(pstruct);}- XmlRpcMethodCall call = new XmlRpcMethodCall("InsertMovieHash", parms);+ var call = new XmlRpcMethodCall("InsertMovieHash", parms);OSHConsole.WriteLine("Sending InsertMovieHash request to the server ...", DebugCode.Good);// Send the request to the server@@ -1399,12 +1399,12 @@ namespace OpenSubtitlesHandler{if (calls[0].Parameters.Count > 0){- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];// Create the response, we'll need it later- MethodResponseInsertMovieHash R = new MethodResponseInsertMovieHash();+ var R = new MethodResponseInsertMovieHash();// To make sure response is not currepted by server, do it in loop- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ foreach (var MEMBER in mainStruct.Members){switch (MEMBER.Name){@@ -1417,14 +1417,14 @@ namespace OpenSubtitlesHandlerOSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString());break;case "data":- XmlRpcValueStruct dataStruct = (XmlRpcValueStruct)MEMBER.Data;- foreach (XmlRpcStructMember dataMember in dataStruct.Members)+ var dataStruct = (XmlRpcValueStruct)MEMBER.Data;+ foreach (var dataMember in dataStruct.Members){switch (dataMember.Name){case "accepted_moviehashes":- XmlRpcValueArray mh = (XmlRpcValueArray)dataMember.Data;- foreach (IXmlRpcValue val in mh.Values)+ var mh = (XmlRpcValueArray)dataMember.Data;+ foreach (var val in mh.Values){if (val is XmlRpcValueBasic){@@ -1433,8 +1433,8 @@ namespace OpenSubtitlesHandler}break;case "new_imdbs":- XmlRpcValueArray mi = (XmlRpcValueArray)dataMember.Data;- foreach (IXmlRpcValue val in mi.Values)+ var mi = (XmlRpcValueArray)dataMember.Data;+ foreach (var val in mi.Values){if (val is XmlRpcValueBasic){@@ -1472,10 +1472,10 @@ namespace OpenSubtitlesHandlerreturn new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");}// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));parms.Add(new XmlRpcValueBasic(XML_PRC_USERAGENT, XmlRpcBasicValueType.String));- XmlRpcMethodCall call = new XmlRpcMethodCall("ServerInfo", parms);+ var call = new XmlRpcMethodCall("ServerInfo", parms);OSHConsole.WriteLine("Sending ServerInfo request to the server ...", DebugCode.Good);// Send the request to the server@@ -1488,12 +1488,12 @@ namespace OpenSubtitlesHandler{if (calls[0].Parameters.Count > 0){- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];// Create the response, we'll need it later- MethodResponseServerInfo R = new MethodResponseServerInfo();+ var R = new MethodResponseServerInfo();// To make sure response is not currepted by server, do it in loop- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ foreach (var MEMBER in mainStruct.Members){switch (MEMBER.Name){@@ -1568,8 +1568,8 @@ namespace OpenSubtitlesHandlercase "last_update_strings"://R.total_subtitles_languages = (string)MEMBER.Data.Data;OSHConsole.WriteLine(">" + MEMBER.Name + ":");- XmlRpcValueStruct luStruct = (XmlRpcValueStruct)MEMBER.Data;- foreach (XmlRpcStructMember luMemeber in luStruct.Members)+ var luStruct = (XmlRpcValueStruct)MEMBER.Data;+ foreach (var luMemeber in luStruct.Members){R.last_update_strings.Add(luMemeber.Name + " [" + luMemeber.Data.Data.ToString() + "]");OSHConsole.WriteLine(" >" + luMemeber.Name + "= " + luMemeber.Data.Data.ToString());@@ -1602,10 +1602,10 @@ namespace OpenSubtitlesHandlerreturn new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");}// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));parms.Add(new XmlRpcValueBasic(IDSubMovieFile, XmlRpcBasicValueType.String));- XmlRpcMethodCall call = new XmlRpcMethodCall("ReportWrongMovieHash", parms);+ var call = new XmlRpcMethodCall("ReportWrongMovieHash", parms);OSHConsole.WriteLine("Sending ReportWrongMovieHash request to the server ...", DebugCode.Good);// Send the request to the server@@ -1618,12 +1618,12 @@ namespace OpenSubtitlesHandler{if (calls[0].Parameters.Count > 0){- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];// Create the response, we'll need it later- MethodResponseReportWrongMovieHash R = new MethodResponseReportWrongMovieHash();+ var R = new MethodResponseReportWrongMovieHash();// To make sure response is not currepted by server, do it in loop- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ foreach (var MEMBER in mainStruct.Members){switch (MEMBER.Name){@@ -1666,14 +1666,14 @@ namespace OpenSubtitlesHandlerreturn new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");}// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));- XmlRpcValueStruct s = new XmlRpcValueStruct(new List<XmlRpcStructMember>());+ var s = new XmlRpcValueStruct(new List<XmlRpcStructMember>());s.Members.Add(new XmlRpcStructMember("moviehash", new XmlRpcValueBasic(moviehash)));s.Members.Add(new XmlRpcStructMember("moviebytesize", new XmlRpcValueBasic(moviebytesize)));s.Members.Add(new XmlRpcStructMember("imdbid", new XmlRpcValueBasic(imdbid)));parms.Add(s);- XmlRpcMethodCall call = new XmlRpcMethodCall("ReportWrongImdbMovie", parms);+ var call = new XmlRpcMethodCall("ReportWrongImdbMovie", parms);OSHConsole.WriteLine("Sending ReportWrongImdbMovie request to the server ...", DebugCode.Good);// Send the request to the server@@ -1686,12 +1686,12 @@ namespace OpenSubtitlesHandler{if (calls[0].Parameters.Count > 0){- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];// Create the response, we'll need it later- MethodResponseAddComment R = new MethodResponseAddComment();+ var R = new MethodResponseAddComment();// To make sure response is not currepted by server, do it in loop- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ foreach (var MEMBER in mainStruct.Members){switch (MEMBER.Name){@@ -1725,13 +1725,13 @@ namespace OpenSubtitlesHandlerreturn new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");}// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));- XmlRpcValueStruct s = new XmlRpcValueStruct(new List<XmlRpcStructMember>());+ var s = new XmlRpcValueStruct(new List<XmlRpcStructMember>());s.Members.Add(new XmlRpcStructMember("idsubtitle", new XmlRpcValueBasic(idsubtitle)));s.Members.Add(new XmlRpcStructMember("score", new XmlRpcValueBasic(score)));parms.Add(s);- XmlRpcMethodCall call = new XmlRpcMethodCall("SubtitlesVote", parms);+ var call = new XmlRpcMethodCall("SubtitlesVote", parms);OSHConsole.WriteLine("Sending SubtitlesVote request to the server ...", DebugCode.Good);// Send the request to the server@@ -1744,20 +1744,20 @@ namespace OpenSubtitlesHandler{if (calls[0].Parameters.Count > 0){- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];// Create the response, we'll need it later- MethodResponseSubtitlesVote R = new MethodResponseSubtitlesVote();+ var R = new MethodResponseSubtitlesVote();// To make sure response is not currepted by server, do it in loop- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ foreach (var MEMBER in mainStruct.Members){switch (MEMBER.Name){case "status": R.Status = (string)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;case "seconds": R.Seconds = (double)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;case "data":- XmlRpcValueStruct dataStruct = (XmlRpcValueStruct)MEMBER.Data;- foreach (XmlRpcStructMember dataMemeber in dataStruct.Members)+ var dataStruct = (XmlRpcValueStruct)MEMBER.Data;+ foreach (var dataMemeber in dataStruct.Members){OSHConsole.WriteLine(" >" + dataMemeber.Name + "= " + dataMemeber.Data.Data.ToString());switch (dataMemeber.Name)@@ -1797,14 +1797,14 @@ namespace OpenSubtitlesHandlerreturn new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");}// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));- XmlRpcValueStruct s = new XmlRpcValueStruct(new List<XmlRpcStructMember>());+ var s = new XmlRpcValueStruct(new List<XmlRpcStructMember>());s.Members.Add(new XmlRpcStructMember("idsubtitle", new XmlRpcValueBasic(idsubtitle)));s.Members.Add(new XmlRpcStructMember("comment", new XmlRpcValueBasic(comment)));s.Members.Add(new XmlRpcStructMember("badsubtitle", new XmlRpcValueBasic(badsubtitle)));parms.Add(s);- XmlRpcMethodCall call = new XmlRpcMethodCall("AddComment", parms);+ var call = new XmlRpcMethodCall("AddComment", parms);OSHConsole.WriteLine("Sending AddComment request to the server ...", DebugCode.Good);// Send the request to the server@@ -1817,12 +1817,12 @@ namespace OpenSubtitlesHandler{if (calls[0].Parameters.Count > 0){- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];// Create the response, we'll need it later- MethodResponseAddComment R = new MethodResponseAddComment();+ var R = new MethodResponseAddComment();// To make sure response is not currepted by server, do it in loop- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ foreach (var MEMBER in mainStruct.Members){switch (MEMBER.Name){@@ -1857,14 +1857,14 @@ namespace OpenSubtitlesHandlerreturn new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");}// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));- XmlRpcValueStruct s = new XmlRpcValueStruct(new List<XmlRpcStructMember>());+ var s = new XmlRpcValueStruct(new List<XmlRpcStructMember>());s.Members.Add(new XmlRpcStructMember("sublanguageid", new XmlRpcValueBasic(sublanguageid)));s.Members.Add(new XmlRpcStructMember("idmovieimdb", new XmlRpcValueBasic(idmovieimdb)));s.Members.Add(new XmlRpcStructMember("comment", new XmlRpcValueBasic(comment)));parms.Add(s);- XmlRpcMethodCall call = new XmlRpcMethodCall("AddRequest", parms);+ var call = new XmlRpcMethodCall("AddRequest", parms);OSHConsole.WriteLine("Sending AddRequest request to the server ...", DebugCode.Good);// Send the request to the server@@ -1877,20 +1877,20 @@ namespace OpenSubtitlesHandler{if (calls[0].Parameters.Count > 0){- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];// Create the response, we'll need it later- MethodResponseAddRequest R = new MethodResponseAddRequest();+ var R = new MethodResponseAddRequest();// To make sure response is not currepted by server, do it in loop- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ foreach (var MEMBER in mainStruct.Members){switch (MEMBER.Name){case "status": R.Status = (string)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;case "seconds": R.Seconds = (double)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;case "data":- XmlRpcValueStruct dataStruct = (XmlRpcValueStruct)MEMBER.Data;- foreach (XmlRpcStructMember dataMemeber in dataStruct.Members)+ var dataStruct = (XmlRpcValueStruct)MEMBER.Data;+ foreach (var dataMemeber in dataStruct.Members){switch (dataMemeber.Name){@@ -1926,10 +1926,10 @@ namespace OpenSubtitlesHandlerreturn new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");}// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();parms.Add(new XmlRpcValueBasic(TOKEN));parms.Add(new XmlRpcValueBasic(language));- XmlRpcMethodCall call = new XmlRpcMethodCall("GetSubLanguages", parms);+ var call = new XmlRpcMethodCall("GetSubLanguages", parms);OSHConsole.WriteLine("Sending GetSubLanguages request to the server ...", DebugCode.Good);// Send the request to the server@@ -1942,27 +1942,27 @@ namespace OpenSubtitlesHandler{if (calls[0].Parameters.Count > 0){- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];// Create the response, we'll need it later- MethodResponseGetSubLanguages R = new MethodResponseGetSubLanguages();+ var R = new MethodResponseGetSubLanguages();// To make sure response is not currepted by server, do it in loop- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ foreach (var MEMBER in mainStruct.Members){switch (MEMBER.Name){case "status": R.Status = (string)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;case "seconds": R.Seconds = (double)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;case "data":// array of structs- XmlRpcValueArray array = (XmlRpcValueArray)MEMBER.Data;- foreach (IXmlRpcValue value in array.Values)+ var array = (XmlRpcValueArray)MEMBER.Data;+ foreach (var value in array.Values){if (value is XmlRpcValueStruct){- XmlRpcValueStruct valueStruct = (XmlRpcValueStruct)value;- SubtitleLanguage lang = new SubtitleLanguage();+ var valueStruct = (XmlRpcValueStruct)value;+ var lang = new SubtitleLanguage();OSHConsole.WriteLine(">SubLanguage:");- foreach (XmlRpcStructMember langMemeber in valueStruct.Members)+ foreach (var langMemeber in valueStruct.Members){OSHConsole.WriteLine(" >" + langMemeber.Name + "= " + langMemeber.Data.Data.ToString());switch (langMemeber.Name)@@ -2009,10 +2009,10 @@ namespace OpenSubtitlesHandlerreturn new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");}// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));// We need to gzip texts then code them with base 24- List<string> decodedTexts = new List<string>();+ var decodedTexts = new List<string>();foreach (string text in texts){// compress@@ -2025,7 +2025,7 @@ namespace OpenSubtitlesHandlerdecodedTexts.Add(Convert.ToBase64String(data));}parms.Add(new XmlRpcValueArray(decodedTexts.ToArray()));- XmlRpcMethodCall call = new XmlRpcMethodCall("DetectLanguage", parms);+ var call = new XmlRpcMethodCall("DetectLanguage", parms);OSHConsole.WriteLine("Sending DetectLanguage request to the server ...", DebugCode.Good);// Send the request to the server@@ -2038,12 +2038,12 @@ namespace OpenSubtitlesHandler{if (calls[0].Parameters.Count > 0){- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];// Create the response, we'll need it later- MethodResponseDetectLanguage R = new MethodResponseDetectLanguage();+ var R = new MethodResponseDetectLanguage();// To make sure response is not currepted by server, do it in loop- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ foreach (var MEMBER in mainStruct.Members){switch (MEMBER.Name){@@ -2053,10 +2053,10 @@ namespace OpenSubtitlesHandlerif (MEMBER.Data is XmlRpcValueStruct){OSHConsole.WriteLine(">Languages:");- XmlRpcValueStruct dataStruct = (XmlRpcValueStruct)MEMBER.Data;- foreach (XmlRpcStructMember dataMember in dataStruct.Members)+ var dataStruct = (XmlRpcValueStruct)MEMBER.Data;+ foreach (var dataMember in dataStruct.Members){- DetectLanguageResult lang = new DetectLanguageResult();+ var lang = new DetectLanguageResult();lang.InputSample = dataMember.Name;lang.LanguageID = dataMember.Data.Data.ToString();R.Results.Add(lang);@@ -2095,10 +2095,10 @@ namespace OpenSubtitlesHandlerreturn new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");}// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();parms.Add(new XmlRpcValueBasic(TOKEN));parms.Add(new XmlRpcValueBasic(program));- XmlRpcMethodCall call = new XmlRpcMethodCall("GetAvailableTranslations", parms);+ var call = new XmlRpcMethodCall("GetAvailableTranslations", parms);OSHConsole.WriteLine("Sending GetAvailableTranslations request to the server ...", DebugCode.Good);// Send the request to the server@@ -2111,29 +2111,29 @@ namespace OpenSubtitlesHandler{if (calls[0].Parameters.Count > 0){- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];// Create the response, we'll need it later- MethodResponseGetAvailableTranslations R = new MethodResponseGetAvailableTranslations();+ var R = new MethodResponseGetAvailableTranslations();// To make sure response is not currepted by server, do it in loop- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ foreach (var MEMBER in mainStruct.Members){switch (MEMBER.Name){case "status": R.Status = (string)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;case "seconds": R.Seconds = (double)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;case "data":- XmlRpcValueStruct dataStruct = (XmlRpcValueStruct)MEMBER.Data;+ var dataStruct = (XmlRpcValueStruct)MEMBER.Data;OSHConsole.WriteLine(">data:");- foreach (XmlRpcStructMember dataMember in dataStruct.Members)+ foreach (var dataMember in dataStruct.Members){if (dataMember.Data is XmlRpcValueStruct){- XmlRpcValueStruct resStruct = (XmlRpcValueStruct)dataMember.Data;- GetAvailableTranslationsResult res = new GetAvailableTranslationsResult();+ var resStruct = (XmlRpcValueStruct)dataMember.Data;+ var res = new GetAvailableTranslationsResult();res.LanguageID = dataMember.Name;OSHConsole.WriteLine(" >LanguageID: " + dataMember.Name);- foreach (XmlRpcStructMember resMember in resStruct.Members)+ foreach (var resMember in resStruct.Members){switch (resMember.Name){@@ -2178,12 +2178,12 @@ namespace OpenSubtitlesHandlerreturn new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");}// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();parms.Add(new XmlRpcValueBasic(TOKEN));parms.Add(new XmlRpcValueBasic(iso639));parms.Add(new XmlRpcValueBasic(format));parms.Add(new XmlRpcValueBasic(program));- XmlRpcMethodCall call = new XmlRpcMethodCall("GetTranslation", parms);+ var call = new XmlRpcMethodCall("GetTranslation", parms);OSHConsole.WriteLine("Sending GetTranslation request to the server ...", DebugCode.Good);// Send the request to the server@@ -2197,12 +2197,12 @@ namespace OpenSubtitlesHandler{if (calls[0].Parameters.Count > 0){- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];// Create the response, we'll need it later- MethodResponseGetTranslation R = new MethodResponseGetTranslation();+ var R = new MethodResponseGetTranslation();// To make sure response is not currepted by server, do it in loop- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ foreach (var MEMBER in mainStruct.Members){switch (MEMBER.Name){@@ -2236,12 +2236,12 @@ namespace OpenSubtitlesHandlerreturn new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");}*/// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();// parms.Add(new XmlRpcValueBasic(TOKEN));parms.Add(new XmlRpcValueBasic(program));// parms.Add(new XmlRpcValueBasic(XML_PRC_USERAGENT));- XmlRpcMethodCall call = new XmlRpcMethodCall("AutoUpdate", parms);+ var call = new XmlRpcMethodCall("AutoUpdate", parms);OSHConsole.WriteLine("Sending AutoUpdate request to the server ...", DebugCode.Good);// Send the request to the serverstring response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));@@ -2253,12 +2253,12 @@ namespace OpenSubtitlesHandler{if (calls[0].Parameters.Count > 0){- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];// Create the response, we'll need it later- MethodResponseAutoUpdate R = new MethodResponseAutoUpdate();+ var R = new MethodResponseAutoUpdate();// To make sure response is not currepted by server, do it in loop- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ foreach (var MEMBER in mainStruct.Members){switch (MEMBER.Name){@@ -2296,10 +2296,10 @@ namespace OpenSubtitlesHandlerreturn new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");}// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();parms.Add(new XmlRpcValueBasic(TOKEN));parms.Add(new XmlRpcValueArray(hashes));- XmlRpcMethodCall call = new XmlRpcMethodCall("CheckMovieHash", parms);+ var call = new XmlRpcMethodCall("CheckMovieHash", parms);OSHConsole.WriteLine("Sending CheckMovieHash request to the server ...", DebugCode.Good);// Send the request to the server@@ -2312,27 +2312,27 @@ namespace OpenSubtitlesHandler{if (calls[0].Parameters.Count > 0){- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];// Create the response, we'll need it later- MethodResponseCheckMovieHash R = new MethodResponseCheckMovieHash();+ var R = new MethodResponseCheckMovieHash();// To make sure response is not currepted by server, do it in loop- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ foreach (var MEMBER in mainStruct.Members){switch (MEMBER.Name){case "status": R.Status = (string)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;case "seconds": R.Seconds = (double)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;case "data":- XmlRpcValueStruct dataStruct = (XmlRpcValueStruct)MEMBER.Data;+ var dataStruct = (XmlRpcValueStruct)MEMBER.Data;OSHConsole.WriteLine(">Data:");- foreach (XmlRpcStructMember dataMember in dataStruct.Members)+ foreach (var dataMember in dataStruct.Members){- CheckMovieHashResult res = new CheckMovieHashResult();+ var res = new CheckMovieHashResult();res.Name = dataMember.Name;OSHConsole.WriteLine(" >" + res.Name + ":");- XmlRpcValueStruct movieStruct = (XmlRpcValueStruct)dataMember.Data;- foreach (XmlRpcStructMember movieMember in movieStruct.Members)+ var movieStruct = (XmlRpcValueStruct)dataMember.Data;+ foreach (var movieMember in movieStruct.Members){switch (movieMember.Name){@@ -2373,10 +2373,10 @@ namespace OpenSubtitlesHandlerreturn new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");}// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();parms.Add(new XmlRpcValueBasic(TOKEN));parms.Add(new XmlRpcValueArray(hashes));- XmlRpcMethodCall call = new XmlRpcMethodCall("CheckMovieHash2", parms);+ var call = new XmlRpcMethodCall("CheckMovieHash2", parms);OSHConsole.WriteLine("Sending CheckMovieHash2 request to the server ...", DebugCode.Good);// Send the request to the server@@ -2389,31 +2389,31 @@ namespace OpenSubtitlesHandler{if (calls[0].Parameters.Count > 0){- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];// Create the response, we'll need it later- MethodResponseCheckMovieHash2 R = new MethodResponseCheckMovieHash2();+ var R = new MethodResponseCheckMovieHash2();// To make sure response is not currepted by server, do it in loop- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ foreach (var MEMBER in mainStruct.Members){switch (MEMBER.Name){case "status": R.Status = (string)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;case "seconds": R.Seconds = (double)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;case "data":- XmlRpcValueStruct dataStruct = (XmlRpcValueStruct)MEMBER.Data;+ var dataStruct = (XmlRpcValueStruct)MEMBER.Data;OSHConsole.WriteLine(">Data:");- foreach (XmlRpcStructMember dataMember in dataStruct.Members)+ foreach (var dataMember in dataStruct.Members){- CheckMovieHash2Result res = new CheckMovieHash2Result();+ var res = new CheckMovieHash2Result();res.Name = dataMember.Name;OSHConsole.WriteLine(" >" + res.Name + ":");- XmlRpcValueArray dataArray = (XmlRpcValueArray)dataMember.Data;+ var dataArray = (XmlRpcValueArray)dataMember.Data;foreach (XmlRpcValueStruct movieStruct in dataArray.Values){- CheckMovieHash2Data d = new CheckMovieHash2Data();- foreach (XmlRpcStructMember movieMember in movieStruct.Members)+ var d = new CheckMovieHash2Data();+ foreach (var movieMember in movieStruct.Members){switch (movieMember.Name){@@ -2459,10 +2459,10 @@ namespace OpenSubtitlesHandlerreturn new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");}// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();parms.Add(new XmlRpcValueBasic(TOKEN));parms.Add(new XmlRpcValueArray(hashes));- XmlRpcMethodCall call = new XmlRpcMethodCall("CheckSubHash", parms);+ var call = new XmlRpcMethodCall("CheckSubHash", parms);OSHConsole.WriteLine("Sending CheckSubHash request to the server ...", DebugCode.Good);// Send the request to the server@@ -2475,12 +2475,12 @@ namespace OpenSubtitlesHandler{if (calls[0].Parameters.Count > 0){- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];// Create the response, we'll need it later- MethodResponseCheckSubHash R = new MethodResponseCheckSubHash();+ var R = new MethodResponseCheckSubHash();// To make sure response is not currepted by server, do it in loop- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ foreach (var MEMBER in mainStruct.Members){switch (MEMBER.Name){@@ -2488,11 +2488,11 @@ namespace OpenSubtitlesHandlercase "seconds": R.Seconds = (double)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;case "data":OSHConsole.WriteLine(">Data:");- XmlRpcValueStruct dataStruct = (XmlRpcValueStruct)MEMBER.Data;- foreach (XmlRpcStructMember dataMember in dataStruct.Members)+ var dataStruct = (XmlRpcValueStruct)MEMBER.Data;+ foreach (var dataMember in dataStruct.Members){OSHConsole.WriteLine(" >" + dataMember.Name + "= " + dataMember.Data.Data.ToString());- CheckSubHashResult r = new CheckSubHashResult();+ var r = new CheckSubHashResult();r.Hash = dataMember.Name;r.SubID = dataMember.Data.Data.ToString();R.Results.Add(r);@@ -2526,14 +2526,14 @@ namespace OpenSubtitlesHandlerreturn new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");}// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));- XmlRpcValueStruct s = new XmlRpcValueStruct(new List<XmlRpcStructMember>());+ var s = new XmlRpcValueStruct(new List<XmlRpcStructMember>());int i = 1;- foreach (TryUploadSubtitlesParameters cd in subs)+ foreach (var cd in subs){- XmlRpcStructMember member = new XmlRpcStructMember("cd" + i, null);- XmlRpcValueStruct memberStruct = new XmlRpcValueStruct(new List<XmlRpcStructMember>());+ var member = new XmlRpcStructMember("cd" + i, null);+ var memberStruct = new XmlRpcValueStruct(new List<XmlRpcStructMember>());memberStruct.Members.Add(new XmlRpcStructMember("subhash", new XmlRpcValueBasic(cd.subhash)));memberStruct.Members.Add(new XmlRpcStructMember("subfilename", new XmlRpcValueBasic(cd.subfilename)));memberStruct.Members.Add(new XmlRpcStructMember("moviehash", new XmlRpcValueBasic(cd.moviehash)));@@ -2547,7 +2547,7 @@ namespace OpenSubtitlesHandleri++;}parms.Add(s);- XmlRpcMethodCall call = new XmlRpcMethodCall("TryUploadSubtitles", parms);+ var call = new XmlRpcMethodCall("TryUploadSubtitles", parms);OSHConsole.WriteLine("Sending TryUploadSubtitles request to the server ...", DebugCode.Good);// Send the request to the server@@ -2560,12 +2560,12 @@ namespace OpenSubtitlesHandler{if (calls[0].Parameters.Count > 0){- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];// Create the response, we'll need it later- MethodResponseTryUploadSubtitles R = new MethodResponseTryUploadSubtitles();+ var R = new MethodResponseTryUploadSubtitles();// To make sure response is not currepted by server, do it in loop- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ foreach (var MEMBER in mainStruct.Members){switch (MEMBER.Name){@@ -2577,14 +2577,14 @@ namespace OpenSubtitlesHandler{OSHConsole.WriteLine("Results: ");- XmlRpcValueArray rarray = (XmlRpcValueArray)MEMBER.Data;- foreach (IXmlRpcValue subStruct in rarray.Values)+ var rarray = (XmlRpcValueArray)MEMBER.Data;+ foreach (var subStruct in rarray.Values){if (subStruct == null) continue;if (!(subStruct is XmlRpcValueStruct)) continue;- SubtitleSearchResult result = new SubtitleSearchResult();- foreach (XmlRpcStructMember submember in ((XmlRpcValueStruct)subStruct).Members)+ var result = new SubtitleSearchResult();+ foreach (var submember in ((XmlRpcValueStruct)subStruct).Members){// To avoid errors of arranged info or missing ones, let's do it with switch..switch (submember.Name)@@ -2658,14 +2658,14 @@ namespace OpenSubtitlesHandlerreturn new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");}// Method call ..- List<IXmlRpcValue> parms = new List<IXmlRpcValue>();+ var parms = new List<IXmlRpcValue>();parms.Add(new XmlRpcValueBasic(TOKEN));// Main struct- XmlRpcValueStruct s = new XmlRpcValueStruct(new List<XmlRpcStructMember>());+ var s = new XmlRpcValueStruct(new List<XmlRpcStructMember>());// Base info member as struct- XmlRpcStructMember member = new XmlRpcStructMember("baseinfo", null);- XmlRpcValueStruct memberStruct = new XmlRpcValueStruct(new List<XmlRpcStructMember>());+ var member = new XmlRpcStructMember("baseinfo", null);+ var memberStruct = new XmlRpcValueStruct(new List<XmlRpcStructMember>());memberStruct.Members.Add(new XmlRpcStructMember("idmovieimdb", new XmlRpcValueBasic(info.idmovieimdb)));memberStruct.Members.Add(new XmlRpcStructMember("sublanguageid", new XmlRpcValueBasic(info.sublanguageid)));memberStruct.Members.Add(new XmlRpcStructMember("moviereleasename", new XmlRpcValueBasic(info.moviereleasename)));@@ -2679,10 +2679,10 @@ namespace OpenSubtitlesHandler// CDS membersint i = 1;- foreach (UploadSubtitleParameters cd in info.CDS)+ foreach (var cd in info.CDS){- XmlRpcStructMember member2 = new XmlRpcStructMember("cd" + i, null);- XmlRpcValueStruct memberStruct2 = new XmlRpcValueStruct(new List<XmlRpcStructMember>());+ var member2 = new XmlRpcStructMember("cd" + i, null);+ var memberStruct2 = new XmlRpcValueStruct(new List<XmlRpcStructMember>());memberStruct2.Members.Add(new XmlRpcStructMember("subhash", new XmlRpcValueBasic(cd.subhash)));memberStruct2.Members.Add(new XmlRpcStructMember("subfilename", new XmlRpcValueBasic(cd.subfilename)));memberStruct2.Members.Add(new XmlRpcStructMember("moviehash", new XmlRpcValueBasic(cd.moviehash)));@@ -2701,7 +2701,7 @@ namespace OpenSubtitlesHandlerparms.Add(s);// add user agent//parms.Add(new XmlRpcValueBasic(XML_PRC_USERAGENT));- XmlRpcMethodCall call = new XmlRpcMethodCall("UploadSubtitles", parms);+ var call = new XmlRpcMethodCall("UploadSubtitles", parms);OSHConsole.WriteLine("Sending UploadSubtitles request to the server ...", DebugCode.Good);// Send the request to the serverstring response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));@@ -2713,12 +2713,12 @@ namespace OpenSubtitlesHandler{if (calls[0].Parameters.Count > 0){- XmlRpcValueStruct mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];+ var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];// Create the response, we'll need it later- MethodResponseUploadSubtitles R = new MethodResponseUploadSubtitles();+ var R = new MethodResponseUploadSubtitles();// To make sure response is not currepted by server, do it in loop- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)+ foreach (var MEMBER in mainStruct.Members){switch (MEMBER.Name){diff --git a/OpenSubtitlesHandler/Utilities.cs b/OpenSubtitlesHandler/Utilities.csindex 468fdd2543..8ea0c546d6 100644--- a/OpenSubtitlesHandler/Utilities.cs+++ b/OpenSubtitlesHandler/Utilities.cs@@ -56,9 +56,9 @@ namespace OpenSubtitlesHandler/// <returns>Bytes array of decompressed data</returns>public static byte[] Decompress(Stream dataToDecompress){- using (MemoryStream target = new MemoryStream())+ using (var target = new MemoryStream()){- using (System.IO.Compression.GZipStream decompressionStream = new System.IO.Compression.GZipStream(dataToDecompress, System.IO.Compression.CompressionMode.Decompress))+ using (var decompressionStream = new System.IO.Compression.GZipStream(dataToDecompress, System.IO.Compression.CompressionMode.Decompress)){decompressionStream.CopyTo(target);}@@ -116,7 +116,7 @@ namespace OpenSubtitlesHandlerusing (responseStream){// Handle response, should be XML text.- List<byte> data = new List<byte>();+ var data = new List<byte>();while (true){int r = responseStream.ReadByte();diff --git a/OpenSubtitlesHandler/XML-RPC/Values/XmlRpcValueArray.cs b/OpenSubtitlesHandler/XML-RPC/Values/XmlRpcValueArray.csindex 3303e38487..d10a80175b 100644--- a/OpenSubtitlesHandler/XML-RPC/Values/XmlRpcValueArray.cs+++ b/OpenSubtitlesHandler/XML-RPC/Values/XmlRpcValueArray.cs@@ -82,7 +82,7 @@ namespace XmlRpcHandlerbase(){values = new List<IXmlRpcValue>();- foreach (DateTime val in dates)+ foreach (var val in dates){values.Add(new XmlRpcValueBasic(val));}@@ -91,7 +91,7 @@ namespace XmlRpcHandlerbase(){values = new List<IXmlRpcValue>();- foreach (XmlRpcValueBasic val in basicValues)+ foreach (var val in basicValues){values.Add(val);}@@ -100,7 +100,7 @@ namespace XmlRpcHandlerbase(){values = new List<IXmlRpcValue>();- foreach (XmlRpcValueStruct val in structs)+ foreach (var val in structs){values.Add(val);}@@ -109,7 +109,7 @@ namespace XmlRpcHandlerbase(){values = new List<IXmlRpcValue>();- foreach (XmlRpcValueArray val in arrays)+ foreach (var val in arrays){values.Add(val);}diff --git a/OpenSubtitlesHandler/XML-RPC/XmlRpcGenerator.cs b/OpenSubtitlesHandler/XML-RPC/XmlRpcGenerator.csindex 3d02622da8..b1351f9e3a 100644--- a/OpenSubtitlesHandler/XML-RPC/XmlRpcGenerator.cs+++ b/OpenSubtitlesHandler/XML-RPC/XmlRpcGenerator.cs@@ -50,17 +50,17 @@ namespace XmlRpcHandlerif (methods.Length == 0)throw new Exception("No method to write !");// Create xml- XmlWriterSettings sett = new XmlWriterSettings();+ var sett = new XmlWriterSettings();sett.Indent = true;sett.Encoding = Encoding.UTF8;using (var ms = new MemoryStream()){- using (XmlWriter XMLwrt = XmlWriter.Create(ms, sett))+ using (var XMLwrt = XmlWriter.Create(ms, sett)){// Let's write the methods- foreach (XmlRpcMethodCall method in methods)+ foreach (var method in methods){XMLwrt.WriteStartElement("methodCall");//methodCallXMLwrt.WriteStartElement("methodName");//methodName@@ -68,7 +68,7 @@ namespace XmlRpcHandlerXMLwrt.WriteEndElement();//methodNameXMLwrt.WriteStartElement("params");//params// Write values- foreach (IXmlRpcValue p in method.Parameters)+ foreach (var p in method.Parameters){XMLwrt.WriteStartElement("param");//paramif (p is XmlRpcValueBasic)@@ -101,8 +101,8 @@ namespace XmlRpcHandler/// <returns></returns>public static XmlRpcMethodCall[] DecodeMethodResponse(string xmlResponse){- List<XmlRpcMethodCall> methods = new List<XmlRpcMethodCall>();- XmlReaderSettings sett = new XmlReaderSettings();+ var methods = new List<XmlRpcMethodCall>();+ var sett = new XmlReaderSettings();sett.DtdProcessing = DtdProcessing.Ignore;sett.IgnoreWhitespace = true;MemoryStream str;@@ -116,15 +116,15 @@ namespace XmlRpcHandler}using (str){- using (XmlReader XMLread = XmlReader.Create(str, sett))+ using (var XMLread = XmlReader.Create(str, sett)){- XmlRpcMethodCall call = new XmlRpcMethodCall("methodResponse");+ var call = new XmlRpcMethodCall("methodResponse");// Read parameterswhile (XMLread.Read()){if (XMLread.Name == "param" && XMLread.IsStartElement()){- IXmlRpcValue val = ReadValue(XMLread);+ var val = ReadValue(XMLread);if (val != null)call.Parameters.Add(val);}@@ -169,7 +169,7 @@ namespace XmlRpcHandler// Get date time formatif (val.Data != null){- DateTime time = (DateTime)val.Data;+ var time = (DateTime)val.Data;string dt = time.Year + time.Month.ToString("D2") + time.Day.ToString("D2") +"T" + time.Hour.ToString("D2") + ":" + time.Minute.ToString("D2") + ":" +time.Second.ToString("D2");@@ -190,7 +190,7 @@ namespace XmlRpcHandler{XMLwrt.WriteStartElement("value");//valueXMLwrt.WriteStartElement("struct");//struct- foreach (XmlRpcStructMember member in val.Members)+ foreach (var member in val.Members){XMLwrt.WriteStartElement("member");//member@@ -221,7 +221,7 @@ namespace XmlRpcHandlerXMLwrt.WriteStartElement("value");//valueXMLwrt.WriteStartElement("array");//arrayXMLwrt.WriteStartElement("data");//data- foreach (IXmlRpcValue o in val.Values)+ foreach (var o in val.Values){if (o is XmlRpcValueBasic){@@ -283,7 +283,7 @@ namespace XmlRpcHandlerint hour = int.Parse(date.Substring(9, 2), UsCulture);int minute = int.Parse(date.Substring(12, 2), UsCulture);//19980717T14:08:55int sec = int.Parse(date.Substring(15, 2), UsCulture);- DateTime time = new DateTime(year, month, day, hour, minute, sec);+ var time = new DateTime(year, month, day, hour, minute, sec);return new XmlRpcValueBasic(time, XmlRpcBasicValueType.dateTime_iso8601);}else if (xmlReader.Name == "base64" && xmlReader.IsStartElement())@@ -293,17 +293,17 @@ namespace XmlRpcHandler}else if (xmlReader.Name == "struct" && xmlReader.IsStartElement()){- XmlRpcValueStruct strct = new XmlRpcValueStruct(new List<XmlRpcStructMember>());+ var strct = new XmlRpcValueStruct(new List<XmlRpcStructMember>());// Read members...while (xmlReader.Read()){if (xmlReader.Name == "member" && xmlReader.IsStartElement()){- XmlRpcStructMember member = new XmlRpcStructMember("", null);+ var member = new XmlRpcStructMember("", null);xmlReader.Read();// read namemember.Name = ReadString(xmlReader);- IXmlRpcValue val = ReadValue(xmlReader, true);+ var val = ReadValue(xmlReader, true);if (val != null){member.Data = val;@@ -319,7 +319,7 @@ namespace XmlRpcHandler}else if (xmlReader.Name == "array" && xmlReader.IsStartElement()){- XmlRpcValueArray array = new XmlRpcValueArray();+ var array = new XmlRpcValueArray();// Read members...while (xmlReader.Read()){@@ -329,7 +329,7 @@ namespace XmlRpcHandler}else{- IXmlRpcValue val = ReadValue(xmlReader);+ var val = ReadValue(xmlReader);if (val != null)array.Values.Add(val);}diff --git a/RSSDP/DeviceAvailableEventArgs.cs b/RSSDP/DeviceAvailableEventArgs.csindex e52e801c49..9106e27e53 100644--- a/RSSDP/DeviceAvailableEventArgs.cs+++ b/RSSDP/DeviceAvailableEventArgs.cs@@ -7,7 +7,7 @@ using MediaBrowser.Model.Net;namespace Rssdp{/// <summary>- /// Event arguments for the <see cref="Rssdp.Infrastructure.SsdpDeviceLocatorBase.DeviceAvailable"/> event.+ /// Event arguments for the <see cref="Infrastructure.SsdpDeviceLocatorBase.DeviceAvailable"/> event./// </summary>public sealed class DeviceAvailableEventArgs : EventArgs{@@ -18,17 +18,17 @@ namespace Rssdpprivate readonly DiscoveredSsdpDevice _DiscoveredDevice;private readonly bool _IsNewlyDiscovered;- #endregion+ #endregion- #region Constructors+ #region Constructors- /// <summary>- /// Full constructor.- /// </summary>- /// <param name="discoveredDevice">A <see cref="DiscoveredSsdpDevice"/> instance representing the available device.</param>- /// <param name="isNewlyDiscovered">A boolean value indicating whether or not this device came from the cache. See <see cref="IsNewlyDiscovered"/> for more detail.</param>- /// <exception cref="System.ArgumentNullException">Thrown if the <paramref name="discoveredDevice"/> parameter is null.</exception>- public DeviceAvailableEventArgs(DiscoveredSsdpDevice discoveredDevice, bool isNewlyDiscovered)+ /// <summary>+ /// Full constructor.+ /// </summary>+ /// <param name="discoveredDevice">A <see cref="DiscoveredSsdpDevice"/> instance representing the available device.</param>+ /// <param name="isNewlyDiscovered">A boolean value indicating whether or not this device came from the cache. See <see cref="IsNewlyDiscovered"/> for more detail.</param>+ /// <exception cref="ArgumentNullException">Thrown if the <paramref name="discoveredDevice"/> parameter is null.</exception>+ public DeviceAvailableEventArgs(DiscoveredSsdpDevice discoveredDevice, bool isNewlyDiscovered){if (discoveredDevice == null) throw new ArgumentNullException(nameof(discoveredDevice));@@ -48,10 +48,10 @@ namespace Rssdpget { return _IsNewlyDiscovered; }}- /// <summary>- /// A reference to a <see cref="Rssdp.DiscoveredSsdpDevice"/> instance containing the discovered details and allowing access to the full device description.- /// </summary>- public DiscoveredSsdpDevice DiscoveredDevice+ /// <summary>+ /// A reference to a <see cref="DiscoveredSsdpDevice"/> instance containing the discovered details and allowing access to the full device description.+ /// </summary>+ public DiscoveredSsdpDevice DiscoveredDevice{get { return _DiscoveredDevice; }}diff --git a/RSSDP/DeviceEventArgs.cs b/RSSDP/DeviceEventArgs.csindex 55b23b68c9..3925ba2481 100644--- a/RSSDP/DeviceEventArgs.cs+++ b/RSSDP/DeviceEventArgs.cs@@ -22,7 +22,7 @@ namespace Rssdp/// Constructs a new instance for the specified <see cref="SsdpDevice"/>./// </summary>/// <param name="device">The <see cref="SsdpDevice"/> associated with the event this argument class is being used for.</param>- /// <exception cref="System.ArgumentNullException">Thrown if the <paramref name="device"/> argument is null.</exception>+ /// <exception cref="ArgumentNullException">Thrown if the <paramref name="device"/> argument is null.</exception>public DeviceEventArgs(SsdpDevice device){if (device == null) throw new ArgumentNullException(nameof(device));diff --git a/RSSDP/DeviceUnavailableEventArgs.cs b/RSSDP/DeviceUnavailableEventArgs.csindex ecba7c0132..d90ddfb603 100644--- a/RSSDP/DeviceUnavailableEventArgs.cs+++ b/RSSDP/DeviceUnavailableEventArgs.cs@@ -6,7 +6,7 @@ using System.Threading.Tasks;namespace Rssdp{/// <summary>- /// Event arguments for the <see cref="Rssdp.Infrastructure.SsdpDeviceLocatorBase.DeviceUnavailable"/> event.+ /// Event arguments for the <see cref="Infrastructure.SsdpDeviceLocatorBase.DeviceUnavailable"/> event./// </summary>public sealed class DeviceUnavailableEventArgs : EventArgs{@@ -25,7 +25,7 @@ namespace Rssdp/// </summary>/// <param name="discoveredDevice">A <see cref="DiscoveredSsdpDevice"/> instance representing the device that has become unavailable.</param>/// <param name="expired">A boolean value indicating whether this device is unavailable because it expired, or because it explicitly sent a byebye notification.. See <see cref="Expired"/> for more detail.</param>- /// <exception cref="System.ArgumentNullException">Thrown if the <paramref name="discoveredDevice"/> parameter is null.</exception>+ /// <exception cref="ArgumentNullException">Thrown if the <paramref name="discoveredDevice"/> parameter is null.</exception>public DeviceUnavailableEventArgs(DiscoveredSsdpDevice discoveredDevice, bool expired){if (discoveredDevice == null) throw new ArgumentNullException(nameof(discoveredDevice));@@ -47,7 +47,7 @@ namespace Rssdp}/// <summary>- /// A reference to a <see cref="Rssdp.DiscoveredSsdpDevice"/> instance containing the discovery details of the removed device.+ /// A reference to a <see cref="DiscoveredSsdpDevice"/> instance containing the discovery details of the removed device./// </summary>public DiscoveredSsdpDevice DiscoveredDevice{diff --git a/RSSDP/DiscoveredSsdpDevice.cs b/RSSDP/DiscoveredSsdpDevice.csindex b643e3f081..f42e7c6747 100644--- a/RSSDP/DiscoveredSsdpDevice.cs+++ b/RSSDP/DiscoveredSsdpDevice.cs@@ -11,7 +11,7 @@ namespace Rssdp/// Represents a discovered device, containing basic information about the device and the location of it's full device description document. Also provides convenience methods for retrieving the device description document./// </summary>/// <seealso cref="SsdpDevice"/>- /// <seealso cref="Rssdp.Infrastructure.ISsdpDeviceLocator"/>+ /// <seealso cref="Infrastructure.ISsdpDeviceLocator"/>public sealed class DiscoveredSsdpDevice{diff --git a/RSSDP/DisposableManagedObjectBase.cs b/RSSDP/DisposableManagedObjectBase.csindex 9933194bc8..0f656fb469 100644--- a/RSSDP/DisposableManagedObjectBase.cs+++ b/RSSDP/DisposableManagedObjectBase.cs@@ -20,10 +20,10 @@ namespace Rssdp.Infrastructureprotected abstract void Dispose(bool disposing);/// <summary>- /// Throws and <see cref="System.ObjectDisposedException"/> if the <see cref="IsDisposed"/> property is true.+ /// Throws and <see cref="ObjectDisposedException"/> if the <see cref="IsDisposed"/> property is true./// </summary>/// <seealso cref="IsDisposed"/>- /// <exception cref="System.ObjectDisposedException">Thrown if the <see cref="IsDisposed"/> property is true.</exception>+ /// <exception cref="ObjectDisposedException">Thrown if the <see cref="IsDisposed"/> property is true.</exception>/// <seealso cref="Dispose()"/>protected virtual void ThrowIfDisposed(){diff --git a/RSSDP/HttpParserBase.cs b/RSSDP/HttpParserBase.csindex db496fe6fa..18712470da 100644--- a/RSSDP/HttpParserBase.cs+++ b/RSSDP/HttpParserBase.cs@@ -26,19 +26,19 @@ namespace Rssdp.Infrastructureprivate static byte[] EmptyByteArray = new byte[]{};/// <summary>- /// Parses the <paramref name="data"/> provided into either a <see cref="System.Net.Http.HttpRequestMessage"/> or <see cref="System.Net.Http.HttpResponseMessage"/> object.+ /// Parses the <paramref name="data"/> provided into either a <see cref="HttpRequestMessage"/> or <see cref="HttpResponseMessage"/> object./// </summary>/// <param name="data">A string containing the HTTP message to parse.</param>- /// <returns>Either a <see cref="System.Net.Http.HttpRequestMessage"/> or <see cref="System.Net.Http.HttpResponseMessage"/> object containing the parsed data.</returns>+ /// <returns>Either a <see cref="HttpRequestMessage"/> or <see cref="HttpResponseMessage"/> object containing the parsed data.</returns>public abstract T Parse(string data);/// <summary>- /// Parses a string containing either an HTTP request or response into a <see cref="System.Net.Http.HttpRequestMessage"/> or <see cref="System.Net.Http.HttpResponseMessage"/> object.+ /// Parses a string containing either an HTTP request or response into a <see cref="HttpRequestMessage"/> or <see cref="HttpResponseMessage"/> object./// </summary>- /// <param name="message">A <see cref="System.Net.Http.HttpRequestMessage"/> or <see cref="System.Net.Http.HttpResponseMessage"/> object representing the parsed message.</param>+ /// <param name="message">A <see cref="HttpRequestMessage"/> or <see cref="HttpResponseMessage"/> object representing the parsed message.</param>/// <param name="headers">A reference to the <see cref="System.Net.Http.Headers.HttpHeaders"/> collection for the <paramref name="message"/> object.</param>/// <param name="data">A string containing the data to be parsed.</param>- /// <returns>An <see cref="System.Net.Http.HttpContent"/> object containing the content of the parsed message.</returns>+ /// <returns>An <see cref="HttpContent"/> object containing the content of the parsed message.</returns>[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2202:Do not dispose objects multiple times", Justification = "Honestly, it's fine. MemoryStream doesn't mind.")]protected virtual void Parse(T message, System.Net.Http.Headers.HttpHeaders headers, string data){@@ -61,7 +61,7 @@ namespace Rssdp.Infrastructure/// Used to parse the first line of an HTTP request or response and assign the values to the appropriate properties on the <paramref name="message"/>./// </summary>/// <param name="data">The first line of the HTTP message to be parsed.</param>- /// <param name="message">Either a <see cref="System.Net.Http.HttpResponseMessage"/> or <see cref="System.Net.Http.HttpRequestMessage"/> to assign the parsed values to.</param>+ /// <param name="message">Either a <see cref="HttpResponseMessage"/> or <see cref="HttpRequestMessage"/> to assign the parsed values to.</param>protected abstract void ParseStatusLine(string data, T message);/// <summary>diff --git a/RSSDP/HttpRequestParser.cs b/RSSDP/HttpRequestParser.csindex 1af7f0d515..d4505b8ad6 100644--- a/RSSDP/HttpRequestParser.cs+++ b/RSSDP/HttpRequestParser.cs@@ -9,7 +9,7 @@ using System.Threading.Tasks;namespace Rssdp.Infrastructure{/// <summary>- /// Parses a string into a <see cref="System.Net.Http.HttpRequestMessage"/> or throws an exception.+ /// Parses a string into a <see cref="HttpRequestMessage"/> or throws an exception./// </summary>public sealed class HttpRequestParser : HttpParserBase<HttpRequestMessage>{@@ -26,17 +26,17 @@ namespace Rssdp.Infrastructure#region Public Methods/// <summary>- /// Parses the specified data into a <see cref="System.Net.Http.HttpRequestMessage"/> instance.+ /// Parses the specified data into a <see cref="HttpRequestMessage"/> instance./// </summary>/// <param name="data">A string containing the data to parse.</param>- /// <returns>A <see cref="System.Net.Http.HttpRequestMessage"/> instance containing the parsed data.</returns>- public override System.Net.Http.HttpRequestMessage Parse(string data)+ /// <returns>A <see cref="HttpRequestMessage"/> instance containing the parsed data.</returns>+ public override HttpRequestMessage Parse(string data){- System.Net.Http.HttpRequestMessage retVal = null;+ HttpRequestMessage retVal = null;try{- retVal = new System.Net.Http.HttpRequestMessage();+ retVal = new HttpRequestMessage();Parse(retVal, retVal.Headers, data);@@ -57,7 +57,7 @@ namespace Rssdp.Infrastructure/// Used to parse the first line of an HTTP request or response and assign the values to the appropriate properties on the <paramref name="message"/>./// </summary>/// <param name="data">The first line of the HTTP message to be parsed.</param>- /// <param name="message">Either a <see cref="System.Net.Http.HttpResponseMessage"/> or <see cref="System.Net.Http.HttpRequestMessage"/> to assign the parsed values to.</param>+ /// <param name="message">Either a <see cref="HttpResponseMessage"/> or <see cref="HttpRequestMessage"/> to assign the parsed values to.</param>protected override void ParseStatusLine(string data, HttpRequestMessage message){if (data == null) throw new ArgumentNullException(nameof(data));diff --git a/RSSDP/HttpResponseParser.cs b/RSSDP/HttpResponseParser.csindex d864a8bb74..a77c898ffe 100644--- a/RSSDP/HttpResponseParser.cs+++ b/RSSDP/HttpResponseParser.cs@@ -9,9 +9,9 @@ using System.Threading.Tasks;namespace Rssdp.Infrastructure{/// <summary>- /// Parses a string into a <see cref="System.Net.Http.HttpResponseMessage"/> or throws an exception.+ /// Parses a string into a <see cref="HttpResponseMessage"/> or throws an exception./// </summary>- public sealed class HttpResponseParser : HttpParserBase<System.Net.Http.HttpResponseMessage>+ public sealed class HttpResponseParser : HttpParserBase<HttpResponseMessage>{#region Fields & Constants@@ -26,16 +26,16 @@ namespace Rssdp.Infrastructure#region Public Methods/// <summary>- /// Parses the specified data into a <see cref="System.Net.Http.HttpResponseMessage"/> instance.+ /// Parses the specified data into a <see cref="HttpResponseMessage"/> instance./// </summary>/// <param name="data">A string containing the data to parse.</param>- /// <returns>A <see cref="System.Net.Http.HttpResponseMessage"/> instance containing the parsed data.</returns>+ /// <returns>A <see cref="HttpResponseMessage"/> instance containing the parsed data.</returns>public override HttpResponseMessage Parse(string data){- System.Net.Http.HttpResponseMessage retVal = null;+ HttpResponseMessage retVal = null;try{- retVal = new System.Net.Http.HttpResponseMessage();+ retVal = new HttpResponseMessage();Parse(retVal, retVal.Headers, data);@@ -68,7 +68,7 @@ namespace Rssdp.Infrastructure/// Used to parse the first line of an HTTP request or response and assign the values to the appropriate properties on the <paramref name="message"/>./// </summary>/// <param name="data">The first line of the HTTP message to be parsed.</param>- /// <param name="message">Either a <see cref="System.Net.Http.HttpResponseMessage"/> or <see cref="System.Net.Http.HttpRequestMessage"/> to assign the parsed values to.</param>+ /// <param name="message">Either a <see cref="HttpResponseMessage"/> or <see cref="HttpRequestMessage"/> to assign the parsed values to.</param>protected override void ParseStatusLine(string data, HttpResponseMessage message){if (data == null) throw new ArgumentNullException(nameof(data));diff --git a/RSSDP/ISsdpDeviceLocator.cs b/RSSDP/ISsdpDeviceLocator.csindex 2351f5d621..8f0d39e75a 100644--- a/RSSDP/ISsdpDeviceLocator.cs+++ b/RSSDP/ISsdpDeviceLocator.cs@@ -128,7 +128,7 @@ namespace Rssdp.Infrastructure/// <remarks>/// <para>Does nothing if this instance is not already listening for notifications.</para>/// </remarks>- /// <exception cref="System.ObjectDisposedException">Throw if the <see cref="DisposableManagedObjectBase.IsDisposed"/> property is true.</exception>+ /// <exception cref="ObjectDisposedException">Throw if the <see cref="DisposableManagedObjectBase.IsDisposed"/> property is true.</exception>/// <seealso cref="StartListeningForNotifications"/>/// <seealso cref="DeviceAvailable"/>/// <seealso cref="DeviceUnavailable"/>diff --git a/RSSDP/ISsdpDevicePublisher.cs b/RSSDP/ISsdpDevicePublisher.csindex da2607fc4e..7e914c109d 100644--- a/RSSDP/ISsdpDevicePublisher.cs+++ b/RSSDP/ISsdpDevicePublisher.cs@@ -17,14 +17,14 @@ namespace Rssdp.Infrastructure/// Adds a device (and it's children) to the list of devices being published by this server, making them discoverable to SSDP clients./// </summary>/// <param name="device">The <see cref="SsdpRootDevice"/> instance to add.</param>- /// <returns>An awaitable <see cref="System.Threading.Tasks.Task"/>.</returns>+ /// <returns>An awaitable <see cref="Task"/>.</returns>void AddDevice(SsdpRootDevice device);/// <summary>/// Removes a device (and it's children) from the list of devices being published by this server, making them undiscoverable./// </summary>/// <param name="device">The <see cref="SsdpRootDevice"/> instance to add.</param>- /// <returns>An awaitable <see cref="System.Threading.Tasks.Task"/>.</returns>+ /// <returns>An awaitable <see cref="Task"/>.</returns>Task RemoveDevice(SsdpRootDevice device);/// <summary>diff --git a/RSSDP/SsdpCommunicationsServer.cs b/RSSDP/SsdpCommunicationsServer.csindex 8fb33924f7..abd0dbdad9 100644--- a/RSSDP/SsdpCommunicationsServer.cs+++ b/RSSDP/SsdpCommunicationsServer.cs@@ -73,7 +73,7 @@ namespace Rssdp.Infrastructure/// <summary>/// Minimum constructor./// </summary>- /// <exception cref="System.ArgumentNullException">The <paramref name="socketFactory"/> argument is null.</exception>+ /// <exception cref="ArgumentNullException">The <paramref name="socketFactory"/> argument is null.</exception>public SsdpCommunicationsServer(ISocketFactory socketFactory, INetworkManager networkManager, ILogger logger, bool enableMultiSocketBinding): this(socketFactory, 0, SsdpConstants.SsdpDefaultMulticastTimeToLive, networkManager, logger, enableMultiSocketBinding){@@ -82,8 +82,8 @@ namespace Rssdp.Infrastructure/// <summary>/// Full constructor./// </summary>- /// <exception cref="System.ArgumentNullException">The <paramref name="socketFactory"/> argument is null.</exception>- /// <exception cref="System.ArgumentOutOfRangeException">The <paramref name="multicastTimeToLive"/> argument is less than or equal to zero.</exception>+ /// <exception cref="ArgumentNullException">The <paramref name="socketFactory"/> argument is null.</exception>+ /// <exception cref="ArgumentOutOfRangeException">The <paramref name="multicastTimeToLive"/> argument is less than or equal to zero.</exception>public SsdpCommunicationsServer(ISocketFactory socketFactory, int localPort, int multicastTimeToLive, INetworkManager networkManager, ILogger logger, bool enableMultiSocketBinding){if (socketFactory == null) throw new ArgumentNullException(nameof(socketFactory));@@ -111,7 +111,7 @@ namespace Rssdp.Infrastructure/// <summary>/// Causes the server to begin listening for multicast messages, being SSDP search requests and notifications./// </summary>- /// <exception cref="System.ObjectDisposedException">Thrown if the <see cref="DisposableManagedObjectBase.IsDisposed"/> property is true (because <seealso cref="DisposableManagedObjectBase.Dispose()" /> has been called previously).</exception>+ /// <exception cref="ObjectDisposedException">Thrown if the <see cref="DisposableManagedObjectBase.IsDisposed"/> property is true (because <seealso cref="DisposableManagedObjectBase.Dispose()" /> has been called previously).</exception>public void BeginListeningForBroadcasts(){ThrowIfDisposed();@@ -138,7 +138,7 @@ namespace Rssdp.Infrastructure/// <summary>/// Causes the server to stop listening for multicast messages, being SSDP search requests and notifications./// </summary>- /// <exception cref="System.ObjectDisposedException">Thrown if the <see cref="DisposableManagedObjectBase.IsDisposed"/> property is true (because <seealso cref="DisposableManagedObjectBase.Dispose()" /> has been called previously).</exception>+ /// <exception cref="ObjectDisposedException">Thrown if the <see cref="DisposableManagedObjectBase.IsDisposed"/> property is true (because <seealso cref="DisposableManagedObjectBase.Dispose()" /> has been called previously).</exception>public void StopListeningForBroadcasts(){lock (_BroadcastListenSocketSynchroniser)@@ -269,7 +269,7 @@ namespace Rssdp.Infrastructure/// <summary>/// Stops listening for search responses on the local, unicast socket./// </summary>- /// <exception cref="System.ObjectDisposedException">Thrown if the <see cref="DisposableManagedObjectBase.IsDisposed"/> property is true (because <seealso cref="DisposableManagedObjectBase.Dispose()" /> has been called previously).</exception>+ /// <exception cref="ObjectDisposedException">Thrown if the <see cref="DisposableManagedObjectBase.IsDisposed"/> property is true (because <seealso cref="DisposableManagedObjectBase.Dispose()" /> has been called previously).</exception>public void StopListeningForResponses(){lock (_SendSocketSynchroniser)diff --git a/RSSDP/SsdpDevice.cs b/RSSDP/SsdpDevice.csindex 8dc1805c57..b4c4a88fdd 100644--- a/RSSDP/SsdpDevice.cs+++ b/RSSDP/SsdpDevice.cs@@ -276,8 +276,8 @@ namespace Rssdp/// <para>If the device is already a member of the <see cref="Devices"/> collection, this method does nothing.</para>/// <para>Also sets the <see cref="SsdpEmbeddedDevice.RootDevice"/> property of the added device and all descendant devices to the relevant <see cref="SsdpRootDevice"/> instance.</para>/// </remarks>- /// <exception cref="System.ArgumentNullException">Thrown if the <paramref name="device"/> argument is null.</exception>- /// <exception cref="System.InvalidOperationException">Thrown if the <paramref name="device"/> is already associated with a different <see cref="SsdpRootDevice"/> instance than used in this tree. Can occur if you try to add the same device instance to more than one tree. Also thrown if you try to add a device to itself.</exception>+ /// <exception cref="ArgumentNullException">Thrown if the <paramref name="device"/> argument is null.</exception>+ /// <exception cref="InvalidOperationException">Thrown if the <paramref name="device"/> is already associated with a different <see cref="SsdpRootDevice"/> instance than used in this tree. Can occur if you try to add the same device instance to more than one tree. Also thrown if you try to add a device to itself.</exception>/// <seealso cref="DeviceAdded"/>public void AddDevice(SsdpEmbeddedDevice device){@@ -305,7 +305,7 @@ namespace Rssdp/// <para>If the device is not a member of the <see cref="Devices"/> collection, this method does nothing.</para>/// <para>Also sets the <see cref="SsdpEmbeddedDevice.RootDevice"/> property to null for the removed device and all descendant devices.</para>/// </remarks>- /// <exception cref="System.ArgumentNullException">Thrown if the <paramref name="device"/> argument is null.</exception>+ /// <exception cref="ArgumentNullException">Thrown if the <paramref name="device"/> argument is null.</exception>/// <seealso cref="DeviceRemoved"/>public void RemoveDevice(SsdpEmbeddedDevice device){diff --git a/RSSDP/SsdpDeviceLocator.cs b/RSSDP/SsdpDeviceLocator.csindex ca6093725a..1348cce8da 100644--- a/RSSDP/SsdpDeviceLocator.cs+++ b/RSSDP/SsdpDeviceLocator.cs@@ -185,7 +185,7 @@ namespace Rssdp.Infrastructure/// <seealso cref="StopListeningForNotifications"/>/// <seealso cref="DeviceAvailable"/>/// <seealso cref="DeviceUnavailable"/>- /// <exception cref="System.ObjectDisposedException">Throw if the <see cref="DisposableManagedObjectBase.IsDisposed"/> ty is true.</exception>+ /// <exception cref="ObjectDisposedException">Throw if the <see cref="DisposableManagedObjectBase.IsDisposed"/> ty is true.</exception>public void StartListeningForNotifications(){ThrowIfDisposed();@@ -204,7 +204,7 @@ namespace Rssdp.Infrastructure/// <seealso cref="StartListeningForNotifications"/>/// <seealso cref="DeviceAvailable"/>/// <seealso cref="DeviceUnavailable"/>- /// <exception cref="System.ObjectDisposedException">Throw if the <see cref="DisposableManagedObjectBase.IsDisposed"/> property is true.</exception>+ /// <exception cref="ObjectDisposedException">Throw if the <see cref="DisposableManagedObjectBase.IsDisposed"/> property is true.</exception>public void StopListeningForNotifications(){ThrowIfDisposed();diff --git a/RSSDP/SsdpDevicePublisher.cs b/RSSDP/SsdpDevicePublisher.csindex 031b908ddb..8a73e6a2d3 100644--- a/RSSDP/SsdpDevicePublisher.cs+++ b/RSSDP/SsdpDevicePublisher.cs@@ -76,8 +76,8 @@ namespace Rssdp.Infrastructure/// <para>This method ignores duplicate device adds (if the same device instance is added multiple times, the second and subsequent add calls do nothing).</para>/// </remarks>/// <param name="device">The <see cref="SsdpDevice"/> instance to add.</param>- /// <exception cref="System.ArgumentNullException">Thrown if the <paramref name="device"/> argument is null.</exception>- /// <exception cref="System.InvalidOperationException">Thrown if the <paramref name="device"/> contains property values that are not acceptable to the UPnP 1.0 specification.</exception>+ /// <exception cref="ArgumentNullException">Thrown if the <paramref name="device"/> argument is null.</exception>+ /// <exception cref="InvalidOperationException">Thrown if the <paramref name="device"/> contains property values that are not acceptable to the UPnP 1.0 specification.</exception>[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId = "t", Justification = "Capture task to local variable supresses compiler warning, but task is not really needed.")]public void AddDevice(SsdpRootDevice device){@@ -85,7 +85,7 @@ namespace Rssdp.InfrastructureThrowIfDisposed();- TimeSpan minCacheTime = TimeSpan.Zero;+ var minCacheTime = TimeSpan.Zero;bool wasAdded = false;lock (_Devices){@@ -113,13 +113,13 @@ namespace Rssdp.Infrastructure/// <para>This method does nothing if the device was not found in the collection.</para>/// </remarks>/// <param name="device">The <see cref="SsdpDevice"/> instance to add.</param>- /// <exception cref="System.ArgumentNullException">Thrown if the <paramref name="device"/> argument is null.</exception>+ /// <exception cref="ArgumentNullException">Thrown if the <paramref name="device"/> argument is null.</exception>public async Task RemoveDevice(SsdpRootDevice device){if (device == null) throw new ArgumentNullException(nameof(device));bool wasRemoved = false;- TimeSpan minCacheTime = TimeSpan.Zero;+ var minCacheTime = TimeSpan.Zero;lock (_Devices){if (_Devices.Contains(device))diff --git a/SocketHttpListener/Ext.cs b/SocketHttpListener/Ext.csindex 6b75648284..1251d19c06 100644--- a/SocketHttpListener/Ext.cs+++ b/SocketHttpListener/Ext.cs@@ -161,7 +161,7 @@ namespace SocketHttpListenerinternal static bool Contains<T>(this IEnumerable<T> source, Func<T, bool> condition){- foreach (T elm in source)+ foreach (var elm in source)if (condition(elm))return true;diff --git a/SocketHttpListener/MessageEventArgs.cs b/SocketHttpListener/MessageEventArgs.csindex d9bccbf3f9..8e2151cb7a 100644--- a/SocketHttpListener/MessageEventArgs.cs+++ b/SocketHttpListener/MessageEventArgs.cs@@ -9,8 +9,8 @@ namespace SocketHttpListener/// <remarks>/// A <see cref="WebSocket.OnMessage"/> event occurs when the <see cref="WebSocket"/> receives/// a text or binary data frame.- /// If you want to get the received data, you access the <see cref="MessageEventArgs.Data"/> or- /// <see cref="MessageEventArgs.RawData"/> property.+ /// If you want to get the received data, you access the <see cref="Data"/> or+ /// <see cref="RawData"/> property./// </remarks>public class MessageEventArgs : EventArgs{diff --git a/SocketHttpListener/Net/ChunkStream.cs b/SocketHttpListener/Net/ChunkStream.csindex 4bf3a6dea5..3836947d4c 100644--- a/SocketHttpListener/Net/ChunkStream.cs+++ b/SocketHttpListener/Net/ChunkStream.cs@@ -108,7 +108,7 @@ namespace SocketHttpListener.Netvar chunksForRemoving = new List<Chunk>(count);for (int i = 0; i < count; i++){- Chunk chunk = _chunks[i];+ var chunk = _chunks[i];if (chunk.Offset == chunk.Bytes.Length){@@ -189,7 +189,7 @@ namespace SocketHttpListener.Netint count = _chunks.Count;for (int i = 0; i < count; i++){- Chunk ch = _chunks[i];+ var ch = _chunks[i];if (ch == null || ch.Bytes == null)continue;if (ch.Bytes.Length > 0 && ch.Offset < ch.Bytes.Length)@@ -368,7 +368,7 @@ namespace SocketHttpListener.Netreturn State.Trailer;}- StringReader reader = new StringReader(_saved.ToString());+ var reader = new StringReader(_saved.ToString());string line;while ((line = reader.ReadLine()) != null && line != "")_headers.Add(line);@@ -378,7 +378,7 @@ namespace SocketHttpListener.Netprivate static void ThrowProtocolViolation(string message){- WebException we = new WebException(message, null, WebExceptionStatus.ServerProtocolViolation, null);+ var we = new WebException(message, null, WebExceptionStatus.ServerProtocolViolation, null);throw we;}}diff --git a/SocketHttpListener/Net/ChunkedInputStream.cs b/SocketHttpListener/Net/ChunkedInputStream.csindex cdf7ac649b..8d59a79078 100644--- a/SocketHttpListener/Net/ChunkedInputStream.cs+++ b/SocketHttpListener/Net/ChunkedInputStream.cs@@ -61,7 +61,7 @@ namespace SocketHttpListener.Net: base(stream, buffer, offset, length){_context = context;- WebHeaderCollection coll = (WebHeaderCollection)context.Request.Headers;+ var coll = (WebHeaderCollection)context.Request.Headers;_decoder = new ChunkStream(coll);}@@ -73,13 +73,13 @@ namespace SocketHttpListener.Netprotected override int ReadCore(byte[] buffer, int offset, int count){- IAsyncResult ares = BeginReadCore(buffer, offset, count, null, null);+ var ares = BeginReadCore(buffer, offset, count, null, null);return EndRead(ares);}protected override IAsyncResult BeginReadCore(byte[] buffer, int offset, int size, AsyncCallback cback, object state){- HttpStreamAsyncResult ares = new HttpStreamAsyncResult(this);+ var ares = new HttpStreamAsyncResult(this);ares._callback = cback;ares._state = state;if (_no_more_data || size == 0 || _closed)@@ -107,7 +107,7 @@ namespace SocketHttpListener.Netares._buffer = new byte[8192];ares._offset = 0;ares._count = 8192;- ReadBufferState rb = new ReadBufferState(buffer, offset, size, ares);+ var rb = new ReadBufferState(buffer, offset, size, ares);rb.InitialCount += nread;base.BeginReadCore(ares._buffer, ares._offset, ares._count, OnRead, rb);return ares;@@ -115,8 +115,8 @@ namespace SocketHttpListener.Netprivate void OnRead(IAsyncResult base_ares){- ReadBufferState rb = (ReadBufferState)base_ares.AsyncState;- HttpStreamAsyncResult ares = rb.Ares;+ var rb = (ReadBufferState)base_ares.AsyncState;+ var ares = rb.Ares;try{int nread = base.EndRead(base_ares);@@ -155,7 +155,7 @@ namespace SocketHttpListener.Netif (asyncResult == null)throw new ArgumentNullException(nameof(asyncResult));- HttpStreamAsyncResult ares = asyncResult as HttpStreamAsyncResult;+ var ares = asyncResult as HttpStreamAsyncResult;if (ares == null || !ReferenceEquals(this, ares._parent)){throw new ArgumentException("Invalid async result");diff --git a/SocketHttpListener/Net/HttpConnection.cs b/SocketHttpListener/Net/HttpConnection.csindex f6db5f0b22..e87503118f 100644--- a/SocketHttpListener/Net/HttpConnection.cs+++ b/SocketHttpListener/Net/HttpConnection.cs@@ -212,7 +212,7 @@ namespace SocketHttpListener.Netprivate static void OnRead(IAsyncResult ares){- HttpConnection cnc = (HttpConnection)ares.AsyncState;+ var cnc = (HttpConnection)ares.AsyncState;cnc.OnReadInternal(ares);}@@ -269,7 +269,7 @@ namespace SocketHttpListener.NetClose(true);return;}- HttpListener listener = _epl.Listener;+ var listener = _epl.Listener;if (_lastListener != listener){RemoveConnection();@@ -417,7 +417,7 @@ namespace SocketHttpListener.Net{try{- HttpListenerResponse response = _context.Response;+ var response = _context.Response;response.StatusCode = status;response.ContentType = "text/html";string description = HttpStatusDescription.Get(status);@@ -509,7 +509,7 @@ namespace SocketHttpListener.Netreturn;}- Socket s = _socket;+ var s = _socket;_socket = null;try{diff --git a/SocketHttpListener/Net/HttpEndPointListener.cs b/SocketHttpListener/Net/HttpEndPointListener.csindex 0f1ce696f7..d002c13b2b 100644--- a/SocketHttpListener/Net/HttpEndPointListener.cs+++ b/SocketHttpListener/Net/HttpEndPointListener.cs@@ -160,7 +160,7 @@ namespace SocketHttpListener.Net}catch (Exception ex){- HttpEndPointListener epl = (HttpEndPointListener)acceptEventArg.UserToken;+ var epl = (HttpEndPointListener)acceptEventArg.UserToken;epl._logger.LogError(ex, "Error in socket.AcceptAsync");}@@ -176,7 +176,7 @@ namespace SocketHttpListener.Netprivate static async void ProcessAccept(SocketAsyncEventArgs args){- HttpEndPointListener epl = (HttpEndPointListener)args.UserToken;+ var epl = (HttpEndPointListener)args.UserToken;if (epl._closed){@@ -214,7 +214,7 @@ namespace SocketHttpListener.Netvar localEndPointString = accepted.LocalEndPoint == null ? string.Empty : accepted.LocalEndPoint.ToString();//_logger.LogInformation("HttpEndPointListener Accepting connection from {0} to {1} secure connection requested: {2}", remoteEndPointString, localEndPointString, _secure);- HttpConnection conn = new HttpConnection(epl._logger, accepted, epl, epl._secure, epl._cert, epl._cryptoProvider, epl._streamHelper, epl._textEncoding, epl._fileSystem, epl._environment);+ var conn = new HttpConnection(epl._logger, accepted, epl, epl._secure, epl._cert, epl._cryptoProvider, epl._streamHelper, epl._textEncoding, epl._fileSystem, epl._environment);await conn.Init().ConfigureAwait(false);@@ -276,9 +276,9 @@ namespace SocketHttpListener.Netpublic bool BindContext(HttpListenerContext context){- HttpListenerRequest req = context.Request;+ var req = context.Request;ListenerPrefix prefix;- HttpListener listener = SearchListener(req.Url, out prefix);+ var listener = SearchListener(req.Url, out prefix);if (listener == null)return false;@@ -310,8 +310,8 @@ namespace SocketHttpListener.Netif (host != null && host != ""){- Dictionary<ListenerPrefix, HttpListener> localPrefixes = _prefixes;- foreach (ListenerPrefix p in localPrefixes.Keys)+ var localPrefixes = _prefixes;+ foreach (var p in localPrefixes.Keys){string ppath = p.Path;if (ppath.Length < bestLength)@@ -331,7 +331,7 @@ namespace SocketHttpListener.Netreturn bestMatch;}- List<ListenerPrefix> list = _unhandledPrefixes;+ var list = _unhandledPrefixes;bestMatch = MatchFromList(host, path, list, out prefix);if (path != pathSlash && bestMatch == null)@@ -361,7 +361,7 @@ namespace SocketHttpListener.NetHttpListener bestMatch = null;int bestLength = -1;- foreach (ListenerPrefix p in list)+ foreach (var p in list){string ppath = p.Path;if (ppath.Length < bestLength)@@ -383,7 +383,7 @@ namespace SocketHttpListener.Netif (list == null)return;- foreach (ListenerPrefix p in list)+ foreach (var p in list){if (p.Path == prefix.Path)throw new Exception("net_listener_already");@@ -399,7 +399,7 @@ namespace SocketHttpListener.Netint c = list.Count;for (int i = 0; i < c; i++){- ListenerPrefix p = list[i];+ var p = list[i];if (p.Path == prefix.Path){list.RemoveAt(i);@@ -414,7 +414,7 @@ namespace SocketHttpListener.Netif (_prefixes.Count > 0)return;- List<ListenerPrefix> list = _unhandledPrefixes;+ var list = _unhandledPrefixes;if (list != null && list.Count > 0)return;@@ -434,7 +434,7 @@ namespace SocketHttpListener.Net// Clone the list because RemoveConnection can be called from Closevar connections = new List<HttpConnection>(_unregisteredConnections.Keys);- foreach (HttpConnection c in connections)+ foreach (var c in connections)c.Close(true);_unregisteredConnections.Clear();}diff --git a/SocketHttpListener/Net/HttpEndPointManager.cs b/SocketHttpListener/Net/HttpEndPointManager.csindex 787730ed41..98986333bc 100644--- a/SocketHttpListener/Net/HttpEndPointManager.cs+++ b/SocketHttpListener/Net/HttpEndPointManager.cs@@ -17,7 +17,7 @@ namespace SocketHttpListener.Netpublic static void AddListener(ILogger logger, HttpListener listener){- List<string> added = new List<string>();+ var added = new List<string>();try{lock ((s_ipEndPoints as ICollection).SyncRoot)@@ -64,7 +64,7 @@ namespace SocketHttpListener.Net}}- ListenerPrefix lp = new ListenerPrefix(p);+ var lp = new ListenerPrefix(p);if (lp.Host != "*" && lp.Host != "+" && Uri.CheckHostName(lp.Host) == UriHostNameType.Unknown)throw new HttpListenerException((int)HttpStatusCode.BadRequest, "net_listener_host");@@ -75,7 +75,7 @@ namespace SocketHttpListener.Netthrow new HttpListenerException((int)HttpStatusCode.BadRequest, "net_invalid_path");// listens on all the interfaces if host name cannot be parsed by IPAddress.- HttpEndPointListener epl = GetEPListener(logger, lp.Host, lp.Port, listener, lp.Secure);+ var epl = GetEPListener(logger, lp.Host, lp.Port, listener, lp.Secure);epl.AddPrefix(lp, listener);}@@ -179,14 +179,14 @@ namespace SocketHttpListener.Netprivate static void RemovePrefixInternal(ILogger logger, string prefix, HttpListener listener){- ListenerPrefix lp = new ListenerPrefix(prefix);+ var lp = new ListenerPrefix(prefix);if (lp.Path.IndexOf('%') != -1)return;if (lp.Path.IndexOf("//", StringComparison.Ordinal) != -1)return;- HttpEndPointListener epl = GetEPListener(logger, lp.Host, lp.Port, listener, lp.Secure);+ var epl = GetEPListener(logger, lp.Host, lp.Port, listener, lp.Secure);epl.RemovePrefix(lp, listener);}}diff --git a/SocketHttpListener/Net/HttpListenerContext.Managed.cs b/SocketHttpListener/Net/HttpListenerContext.Managed.csindex a6622c4798..4cdb6882ec 100644--- a/SocketHttpListener/Net/HttpListenerContext.Managed.cs+++ b/SocketHttpListener/Net/HttpListenerContext.Managed.cs@@ -44,7 +44,7 @@ namespace SocketHttpListener.Net}internal IPrincipal ParseBasicAuthentication(string authData) =>- TryParseBasicAuth(authData, out HttpStatusCode errorCode, out string username, out string password) ?+ TryParseBasicAuth(authData, out var errorCode, out string username, out string password) ?new GenericPrincipal(new HttpListenerBasicIdentity(username, password), Array.Empty<string>()) :null;diff --git a/SocketHttpListener/Net/HttpListenerRequest.Managed.cs b/SocketHttpListener/Net/HttpListenerRequest.Managed.csindex 3f9e32f089..41d0750457 100644--- a/SocketHttpListener/Net/HttpListenerRequest.Managed.cs+++ b/SocketHttpListener/Net/HttpListenerRequest.Managed.cs@@ -180,7 +180,7 @@ namespace SocketHttpListener.Netif (string.Compare(Headers[HttpKnownHeaderNames.Expect], "100-continue", StringComparison.OrdinalIgnoreCase) == 0){- HttpResponseStream output = _context.Connection.GetResponseStream();+ var output = _context.Connection.GetResponseStream();output.InternalWrite(s_100continue, 0, s_100continue.Length);}}@@ -256,7 +256,7 @@ namespace SocketHttpListener.Net{try{- IAsyncResult ares = InputStream.BeginRead(bytes, 0, length, null, null);+ var ares = InputStream.BeginRead(bytes, 0, length, null, null);if (!ares.IsCompleted && !ares.AsyncWaitHandle.WaitOne(1000))return false;if (InputStream.EndRead(ares) <= 0)diff --git a/SocketHttpListener/Net/HttpListenerRequest.cs b/SocketHttpListener/Net/HttpListenerRequest.csindex 2e8396f6f3..1c832367ef 100644--- a/SocketHttpListener/Net/HttpListenerRequest.cs+++ b/SocketHttpListener/Net/HttpListenerRequest.cs@@ -23,7 +23,7 @@ namespace SocketHttpListener.Netprivate static CookieCollection ParseCookies(Uri uri, string setCookieHeader){- CookieCollection cookies = new CookieCollection();+ var cookies = new CookieCollection();return cookies;}@@ -171,7 +171,7 @@ namespace SocketHttpListener.Net{get{- QueryParamCollection queryString = new QueryParamCollection();+ var queryString = new QueryParamCollection();Helpers.FillFromString(queryString, Url.Query, true, ContentEncoding);return queryString;}@@ -197,7 +197,7 @@ namespace SocketHttpListener.Netreturn null;}- bool success = Uri.TryCreate(referrer, UriKind.RelativeOrAbsolute, out Uri urlReferrer);+ bool success = Uri.TryCreate(referrer, UriKind.RelativeOrAbsolute, out var urlReferrer);return success ? urlReferrer : null;}}@@ -296,7 +296,7 @@ namespace SocketHttpListener.Net// collect comma-separated values into list- List<string> values = new List<string>();+ var values = new List<string>();int i = 0;while (i < l)@@ -341,7 +341,7 @@ namespace SocketHttpListener.Netprivate static string UrlDecodeStringFromStringInternal(string s, Encoding e){int count = s.Length;- UrlDecoder helper = new UrlDecoder(count, e);+ var helper = new UrlDecoder(count, e);// go through the string's chars collapsing %XX and %uXXXX and// appending each char as char, with exception of %XX constructsdiff --git a/SocketHttpListener/Net/HttpListenerRequestUriBuilder.cs b/SocketHttpListener/Net/HttpListenerRequestUriBuilder.csindex f1a0af0bf5..310c71a0dc 100644--- a/SocketHttpListener/Net/HttpListenerRequestUriBuilder.cs+++ b/SocketHttpListener/Net/HttpListenerRequestUriBuilder.cs@@ -54,7 +54,7 @@ namespace SocketHttpListener.Netpublic static Uri GetRequestUri(string rawUri, string cookedUriScheme, string cookedUriHost,string cookedUriPath, string cookedUriQuery){- HttpListenerRequestUriBuilder builder = new HttpListenerRequestUriBuilder(rawUri,+ var builder = new HttpListenerRequestUriBuilder(rawUri,cookedUriScheme, cookedUriHost, cookedUriPath, cookedUriQuery);return builder.Build();@@ -94,10 +94,10 @@ namespace SocketHttpListener.Net// Try to check the raw path using first the primary encoding (according to http.sys settings);// if it fails try the secondary encoding.- ParsingResult result = BuildRequestUriUsingRawPath(GetEncoding(EncodingType.Primary));+ var result = BuildRequestUriUsingRawPath(GetEncoding(EncodingType.Primary));if (result == ParsingResult.EncodingError){- Encoding secondaryEncoding = GetEncoding(EncodingType.Secondary);+ var secondaryEncoding = GetEncoding(EncodingType.Secondary);result = BuildRequestUriUsingRawPath(secondaryEncoding);}isValid = (result == ParsingResult.Success) ? true : false;@@ -136,7 +136,7 @@ namespace SocketHttpListener.Net_requestUriString.Append(Uri.SchemeDelimiter);_requestUriString.Append(_cookedUriHost);- ParsingResult result = ParseRawPath(encoding);+ var result = ParseRawPath(encoding);if (result == ParsingResult.Success){_requestUriString.Append(_cookedUriQuery);@@ -327,7 +327,7 @@ namespace SocketHttpListener.Netprivate static string GetOctetsAsString(IEnumerable<byte> octets){- StringBuilder octetString = new StringBuilder();+ var octetString = new StringBuilder();bool first = true;foreach (byte octet in octets)diff --git a/SocketHttpListener/Net/HttpListenerResponse.Managed.cs b/SocketHttpListener/Net/HttpListenerResponse.Managed.csindex 198cdcf764..9f9b8384d5 100644--- a/SocketHttpListener/Net/HttpListenerResponse.Managed.cs+++ b/SocketHttpListener/Net/HttpListenerResponse.Managed.cs@@ -263,8 +263,8 @@ namespace SocketHttpListener.NetComputeCookies();}- Encoding encoding = _textEncoding.GetDefaultEncoding();- StreamWriter writer = new StreamWriter(ms, encoding, 256);+ var encoding = _textEncoding.GetDefaultEncoding();+ var writer = new StreamWriter(ms, encoding, 256);writer.Write("HTTP/1.1 {0} ", _statusCode); // "1.1" matches Windows implementation, which ignores the response versionwriter.Flush();byte[] statusDescriptionBytes = WebHeaderEncoding.GetBytes(StatusDescription);diff --git a/SocketHttpListener/Net/HttpRequestStream.Managed.cs b/SocketHttpListener/Net/HttpRequestStream.Managed.csindex 73a6735311..42fc4d97c2 100644--- a/SocketHttpListener/Net/HttpRequestStream.Managed.cs+++ b/SocketHttpListener/Net/HttpRequestStream.Managed.cs@@ -124,7 +124,7 @@ namespace SocketHttpListener.Net{if (size == 0 || _closed){- HttpStreamAsyncResult ares = new HttpStreamAsyncResult(this);+ var ares = new HttpStreamAsyncResult(this);ares._callback = cback;ares._state = state;ares.Complete();@@ -134,7 +134,7 @@ namespace SocketHttpListener.Netint nread = FillFromBuffer(buffer, offset, size);if (nread > 0 || nread == -1){- HttpStreamAsyncResult ares = new HttpStreamAsyncResult(this);+ var ares = new HttpStreamAsyncResult(this);ares._buffer = buffer;ares._offset = offset;ares._count = size;diff --git a/SocketHttpListener/Net/HttpResponseStream.Managed.cs b/SocketHttpListener/Net/HttpResponseStream.Managed.csindex b4c223418a..cda4fe8bcb 100644--- a/SocketHttpListener/Net/HttpResponseStream.Managed.cs+++ b/SocketHttpListener/Net/HttpResponseStream.Managed.cs@@ -70,7 +70,7 @@ namespace SocketHttpListener.Netprivate void DisposeCore(){byte[] bytes = null;- MemoryStream ms = GetHeaders(true);+ var ms = GetHeaders(true);bool chunked = _response.SendChunked;if (_stream.CanWrite){@@ -110,7 +110,7 @@ namespace SocketHttpListener.Netif (_stream.CanWrite){- MemoryStream ms = GetHeaders(closing: false, isWebSocketHandshake: true);+ var ms = GetHeaders(closing: false, isWebSocketHandshake: true);bool chunked = _response.SendChunked;long start = ms.Position;@@ -146,7 +146,7 @@ namespace SocketHttpListener.Netreturn null;}- MemoryStream ms = new MemoryStream();+ var ms = new MemoryStream();_response.SendHeaders(closing, ms, isWebSocketHandshake);return ms;}@@ -190,7 +190,7 @@ namespace SocketHttpListener.Netreturn;byte[] bytes = null;- MemoryStream ms = GetHeaders(false);+ var ms = GetHeaders(false);bool chunked = _response.SendChunked;if (ms != null){@@ -226,7 +226,7 @@ namespace SocketHttpListener.Net{if (_closed){- HttpStreamAsyncResult ares = new HttpStreamAsyncResult(this);+ var ares = new HttpStreamAsyncResult(this);ares._callback = cback;ares._state = state;ares.Complete();@@ -234,7 +234,7 @@ namespace SocketHttpListener.Net}byte[] bytes = null;- MemoryStream ms = GetHeaders(false);+ var ms = GetHeaders(false);bool chunked = _response.SendChunked;if (ms != null){diff --git a/SocketHttpListener/Net/ListenerPrefix.cs b/SocketHttpListener/Net/ListenerPrefix.csindex 3e78752fdb..edfcb89043 100644--- a/SocketHttpListener/Net/ListenerPrefix.cs+++ b/SocketHttpListener/Net/ListenerPrefix.cs@@ -40,7 +40,7 @@ namespace SocketHttpListener.Net// Equals and GetHashCode are required to detect duplicates in HttpListenerPrefixCollection.public override bool Equals(object o){- ListenerPrefix other = o as ListenerPrefix;+ var other = o as ListenerPrefix;if (other == null)return false;diff --git a/SocketHttpListener/Net/WebHeaderCollection.cs b/SocketHttpListener/Net/WebHeaderCollection.csindex 8c3395df5c..02d3cf61fb 100644--- a/SocketHttpListener/Net/WebHeaderCollection.cs+++ b/SocketHttpListener/Net/WebHeaderCollection.cs@@ -234,7 +234,7 @@ namespace SocketHttpListener.Netinternal string ToStringMultiValue(){- StringBuilder sb = new StringBuilder();+ var sb = new StringBuilder();int count = base.Count;for (int i = 0; i < count; i++)@@ -263,7 +263,7 @@ namespace SocketHttpListener.Netpublic override string ToString(){- StringBuilder sb = new StringBuilder();+ var sb = new StringBuilder();int count = base.Count;for (int i = 0; i < count; i++)diff --git a/SocketHttpListener/Net/WebSockets/HttpWebSocket.Managed.cs b/SocketHttpListener/Net/WebSockets/HttpWebSocket.Managed.csindex 79f87dfc9c..f51f72dba4 100644--- a/SocketHttpListener/Net/WebSockets/HttpWebSocket.Managed.cs+++ b/SocketHttpListener/Net/WebSockets/HttpWebSocket.Managed.cs@@ -16,8 +16,8 @@ namespace SocketHttpListener.Net.WebSocketsValidateOptions(subProtocol, receiveBufferSize, MinSendBufferSize, keepAliveInterval);// get property will create a new response if one doesn't exist.- HttpListenerResponse response = context.Response;- HttpListenerRequest request = context.Request;+ var response = context.Response;+ var request = context.Request;ValidateWebSocketHeaders(context);string secWebSocketVersion = request.Headers[HttpKnownHeaderNames.SecWebSocketVersion];@@ -50,15 +50,15 @@ namespace SocketHttpListener.Net.WebSocketsresponse.StatusCode = (int)HttpStatusCode.SwitchingProtocols; // HTTP 101response.StatusDescription = HttpStatusDescription.Get(HttpStatusCode.SwitchingProtocols);- HttpResponseStream responseStream = response.OutputStream as HttpResponseStream;+ var responseStream = response.OutputStream as HttpResponseStream;// Send websocket handshake headersawait responseStream.WriteWebSocketHandshakeHeadersAsync().ConfigureAwait(false);//WebSocket webSocket = WebSocket.CreateFromStream(context.Connection.ConnectedStream, isServer: true, subProtocol, keepAliveInterval);- WebSocket webSocket = new WebSocket(subProtocol);+ var webSocket = new WebSocket(subProtocol);- HttpListenerWebSocketContext webSocketContext = new HttpListenerWebSocketContext(+ var webSocketContext = new HttpListenerWebSocketContext(request.Url,request.Headers,request.Cookies,diff --git a/SocketHttpListener/Net/WebSockets/HttpWebSocket.cs b/SocketHttpListener/Net/WebSockets/HttpWebSocket.csindex 4667275c5e..b346cc98ec 100644--- a/SocketHttpListener/Net/WebSockets/HttpWebSocket.cs+++ b/SocketHttpListener/Net/WebSockets/HttpWebSocket.cs@@ -19,7 +19,7 @@ namespace SocketHttpListener.Net.WebSocketsstring retVal;// SHA1 used only for hashing purposes, not for crypto. Check here for FIPS compat.- using (SHA1 sha1 = SHA1.Create())+ using (var sha1 = SHA1.Create()){string acceptString = string.Concat(secWebSocketKey, HttpWebSocket.SecWebSocketKeyGuid);byte[] toHash = Encoding.UTF8.GetBytes(acceptString);diff --git a/SocketHttpListener/Net/WebSockets/WebSocketValidate.cs b/SocketHttpListener/Net/WebSockets/WebSocketValidate.csindex 0469e3b6c5..3f61e55fce 100644--- a/SocketHttpListener/Net/WebSockets/WebSocketValidate.cs+++ b/SocketHttpListener/Net/WebSockets/WebSocketValidate.cs@@ -20,7 +20,7 @@ namespace SocketHttpListener.Net.WebSocketsif (validStates != null && validStates.Length > 0){- foreach (WebSocketState validState in validStates)+ foreach (var validState in validStates){if (currentState == validState){