Cleaned up "value assigned is not used in any execution path"

This commit is contained in:
BaronGreenback 2021-04-17 09:27:58 +01:00
parent b63f615fd4
commit 80877aa945
10 changed files with 19 additions and 22 deletions

View File

@ -47,7 +47,7 @@ namespace Emby.Dlna.Service
private async Task<ControlResponse> ProcessControlRequestInternalAsync(ControlRequest request)
{
ControlRequestInfo requestInfo = null;
ControlRequestInfo requestInfo;
using (var streamReader = new StreamReader(request.InputXml, Encoding.UTF8))
{

View File

@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using System;
using System.Buffers;
@ -182,7 +182,7 @@ namespace Emby.Server.Implementations.HttpServer
}
WebSocketMessage<object>? stub;
long bytesConsumed = 0;
long bytesConsumed;
try
{
stub = DeserializeWebSocketMessage(buffer, out bytesConsumed);

View File

@ -87,7 +87,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
Logger.LogInformation("Opening HDHR UDP Live stream from {host}", uri.Host);
var remoteAddress = IPAddress.Parse(uri.Host);
IPAddress localAddress = null;
IPAddress localAddress;
using (var tcpClient = new TcpClient())
{
try

View File

@ -258,7 +258,6 @@ namespace Emby.Server.Implementations.QuickConnect
}
// Expire stale connection requests
var code = string.Empty;
var values = _currentRequests.Values.ToList();
for (int i = 0; i < values.Count; i++)
@ -266,7 +265,7 @@ namespace Emby.Server.Implementations.QuickConnect
var added = values[i].DateAdded ?? DateTime.UnixEpoch;
if (DateTime.UtcNow > added.AddMinutes(Timeout) || expireAll)
{
code = values[i].Code;
var code = values[i].Code;
_logger.LogDebug("Removing expired request {code}", code);
if (!_currentRequests.TryRemove(code, out _))

View File

@ -732,7 +732,7 @@ namespace Jellyfin.Api.Controllers
else
{
// For non series and movie types these columns are typically null
isSeries = null;
// isSeries = null;
isMovie = null;
includeItemTypes.Add(item.GetType().Name);
}

View File

@ -376,7 +376,7 @@ namespace Jellyfin.Api.Controllers
}
else if (string.Equals(segmentFormat, "mp4", StringComparison.OrdinalIgnoreCase))
{
var outputFmp4HeaderArg = string.Empty;
string outputFmp4HeaderArg;
var isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
if (isWindows)
{

View File

@ -61,9 +61,7 @@ namespace MediaBrowser.Controller.LiveTv
{
if (!string.IsNullOrEmpty(Number))
{
double number = 0;
if (double.TryParse(Number, NumberStyles.Any, CultureInfo.InvariantCulture, out number))
if (double.TryParse(Number, NumberStyles.Any, CultureInfo.InvariantCulture, out double number))
{
return string.Format(CultureInfo.InvariantCulture, "{0:00000.0}", number) + "-" + (Name ?? string.Empty);
}

View File

@ -203,7 +203,7 @@ namespace MediaBrowser.LocalMetadata.Images
added = AddImage(files, images, "logo", imagePrefix, isInMixedFolder, ImageType.Logo);
if (!added)
{
added = AddImage(files, images, "clearlogo", imagePrefix, isInMixedFolder, ImageType.Logo);
AddImage(files, images, "clearlogo", imagePrefix, isInMixedFolder, ImageType.Logo);
}
}
@ -220,7 +220,7 @@ namespace MediaBrowser.LocalMetadata.Images
if (!added)
{
added = AddImage(files, images, "disc", imagePrefix, isInMixedFolder, ImageType.Disc);
AddImage(files, images, "disc", imagePrefix, isInMixedFolder, ImageType.Disc);
}
}
else if (item is Video || item is BoxSet)
@ -234,7 +234,7 @@ namespace MediaBrowser.LocalMetadata.Images
if (!added)
{
added = AddImage(files, images, "discart", imagePrefix, isInMixedFolder, ImageType.Disc);
AddImage(files, images, "discart", imagePrefix, isInMixedFolder, ImageType.Disc);
}
}
@ -250,7 +250,7 @@ namespace MediaBrowser.LocalMetadata.Images
added = AddImage(files, images, "landscape", imagePrefix, isInMixedFolder, ImageType.Thumb);
if (!added)
{
added = AddImage(files, images, "thumb", imagePrefix, isInMixedFolder, ImageType.Thumb);
AddImage(files, images, "thumb", imagePrefix, isInMixedFolder, ImageType.Thumb);
}
}

View File

@ -111,10 +111,10 @@ namespace MediaBrowser.Providers.MediaInfo
}
}
if (streamFileNames == null)
{
streamFileNames = Array.Empty<string>();
}
// if (streamFileNames == null)
// {
// streamFileNames = Array.Empty<string>();
// }
mediaInfoResult = await GetMediaInfo(item, cancellationToken).ConfigureAwait(false);

View File

@ -75,21 +75,21 @@ namespace MediaBrowser.Providers.MediaInfo
string[] subtitleDownloadLanguages;
bool skipIfEmbeddedSubtitlesPresent;
bool skipIfAudioTrackMatches;
bool requirePerfectMatch;
// bool requirePerfectMatch;
if (libraryOptions.SubtitleDownloadLanguages == null)
{
subtitleDownloadLanguages = options.DownloadLanguages;
skipIfEmbeddedSubtitlesPresent = options.SkipIfEmbeddedSubtitlesPresent;
skipIfAudioTrackMatches = options.SkipIfAudioTrackMatches;
requirePerfectMatch = options.RequirePerfectMatch;
// requirePerfectMatch = options.RequirePerfectMatch;
}
else
{
subtitleDownloadLanguages = libraryOptions.SubtitleDownloadLanguages;
skipIfEmbeddedSubtitlesPresent = libraryOptions.SkipSubtitlesIfEmbeddedSubtitlesPresent;
skipIfAudioTrackMatches = libraryOptions.SkipSubtitlesIfAudioTrackMatches;
requirePerfectMatch = libraryOptions.RequirePerfectSubtitleMatch;
// requirePerfectMatch = libraryOptions.RequirePerfectSubtitleMatch;
}
foreach (var lang in subtitleDownloadLanguages)