Remove redundant 'else' keywords

This commit is contained in:
Stepan Goremykin 2023-04-06 19:38:34 +02:00
parent b6cfdb8b92
commit 910617bbc3
24 changed files with 188 additions and 193 deletions

View File

@ -1309,7 +1309,8 @@ namespace Emby.Server.Implementations.Data
{ {
return false; return false;
} }
else if (type == typeof(UserRootFolder))
if (type == typeof(UserRootFolder))
{ {
return false; return false;
} }
@ -1319,55 +1320,68 @@ namespace Emby.Server.Implementations.Data
{ {
return false; return false;
} }
else if (type == typeof(MusicArtist))
if (type == typeof(MusicArtist))
{ {
return false; return false;
} }
else if (type == typeof(Person))
if (type == typeof(Person))
{ {
return false; return false;
} }
else if (type == typeof(MusicGenre))
if (type == typeof(MusicGenre))
{ {
return false; return false;
} }
else if (type == typeof(Genre))
if (type == typeof(Genre))
{ {
return false; return false;
} }
else if (type == typeof(Studio))
if (type == typeof(Studio))
{ {
return false; return false;
} }
else if (type == typeof(PlaylistsFolder))
if (type == typeof(PlaylistsFolder))
{ {
return false; return false;
} }
else if (type == typeof(PhotoAlbum))
if (type == typeof(PhotoAlbum))
{ {
return false; return false;
} }
else if (type == typeof(Year))
if (type == typeof(Year))
{ {
return false; return false;
} }
else if (type == typeof(Book))
if (type == typeof(Book))
{ {
return false; return false;
} }
else if (type == typeof(LiveTvProgram))
if (type == typeof(LiveTvProgram))
{ {
return false; return false;
} }
else if (type == typeof(AudioBook))
if (type == typeof(AudioBook))
{ {
return false; return false;
} }
else if (type == typeof(Audio))
if (type == typeof(Audio))
{ {
return false; return false;
} }
else if (type == typeof(MusicAlbum))
if (type == typeof(MusicAlbum))
{ {
return false; return false;
} }

View File

@ -78,7 +78,8 @@ namespace Emby.Server.Implementations.Library.Resolvers
Set3DFormat(videoTmp); Set3DFormat(videoTmp);
return videoTmp; return videoTmp;
} }
else if (IsBluRayDirectory(filename))
if (IsBluRayDirectory(filename))
{ {
var videoTmp = new TVideoType var videoTmp = new TVideoType
{ {

View File

@ -627,11 +627,9 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
_timerProvider.Update(existingTimer); _timerProvider.Update(existingTimer);
return Task.FromResult(existingTimer.Id); return Task.FromResult(existingTimer.Id);
} }
else
{
throw new ArgumentException("A scheduled recording already exists for this program."); throw new ArgumentException("A scheduled recording already exists for this program.");
} }
}
info.Id = Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture); info.Id = Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture);

View File

@ -415,15 +415,14 @@ namespace Emby.Server.Implementations.LiveTv.Listings
{ {
return null; return null;
} }
else if (uri.IndexOf("http", StringComparison.OrdinalIgnoreCase) != -1)
if (uri.IndexOf("http", StringComparison.OrdinalIgnoreCase) != -1)
{ {
return uri; return uri;
} }
else
{
return apiUrl + "/image/" + uri + "?token=" + token; return apiUrl + "/image/" + uri + "?token=" + token;
} }
}
private static double GetAspectRatio(ImageDataDto i) private static double GetAspectRatio(ImageDataDto i)
{ {

View File

@ -620,11 +620,9 @@ namespace Emby.Server.Implementations.SyncPlay
RestartCurrentItem(); RestartCurrentItem();
return true; return true;
} }
else
{
return false; return false;
} }
}
/// <inheritdoc /> /// <inheritdoc />
public bool PreviousItemInQueue() public bool PreviousItemInQueue()
@ -637,11 +635,9 @@ namespace Emby.Server.Implementations.SyncPlay
RestartCurrentItem(); RestartCurrentItem();
return true; return true;
} }
else
{
return false; return false;
} }
}
/// <inheritdoc /> /// <inheritdoc />
public void SetRepeatMode(GroupRepeatMode mode) public void SetRepeatMode(GroupRepeatMode mode)

View File

@ -339,11 +339,9 @@ namespace Emby.Server.Implementations.SyncPlay
{ {
return sessionsCounter > 0; return sessionsCounter > 0;
} }
else
{
return false; return false;
} }
}
/// <summary> /// <summary>
/// Releases unmanaged and optionally managed resources. /// Releases unmanaged and optionally managed resources.

View File

@ -533,11 +533,9 @@ public class SubtitleController : BaseJellyfinApiController
_logger.LogDebug("Fallback font size is {FileSize} Bytes", fileSize); _logger.LogDebug("Fallback font size is {FileSize} Bytes", fileSize);
return PhysicalFile(fontFile.FullName, MimeTypes.GetMimeType(fontFile.FullName)); return PhysicalFile(fontFile.FullName, MimeTypes.GetMimeType(fontFile.FullName));
} }
else
{
_logger.LogWarning("The selected font is null or empty"); _logger.LogWarning("The selected font is null or empty");
} }
}
else else
{ {
_logger.LogWarning("The path of fallback font folder has not been set"); _logger.LogWarning("The path of fallback font folder has not been set");

View File

@ -500,11 +500,9 @@ namespace Jellyfin.Networking.Manager
{ {
return true; return true;
} }
else
{
return address.IsPrivateAddressRange(); return address.IsPrivateAddressRange();
} }
}
/// <inheritdoc/> /// <inheritdoc/>
public bool IsExcludedInterface(IPAddress address) public bool IsExcludedInterface(IPAddress address)
@ -1171,13 +1169,15 @@ namespace Jellyfin.Networking.Manager
bindPreference = addr.Value; bindPreference = addr.Value;
break; break;
} }
else if ((addr.Key.Address.Equals(IPAddress.Any) || addr.Key.Address.Equals(IPAddress.IPv6Any)) && isInExternalSubnet)
if ((addr.Key.Address.Equals(IPAddress.Any) || addr.Key.Address.Equals(IPAddress.IPv6Any)) && isInExternalSubnet)
{ {
// External. // External.
bindPreference = addr.Value; bindPreference = addr.Value;
break; break;
} }
else if (addr.Key.Contains(source))
if (addr.Key.Contains(source))
{ {
// Match ip address. // Match ip address.
bindPreference = addr.Value; bindPreference = addr.Value;

View File

@ -801,8 +801,7 @@ namespace MediaBrowser.Controller.Entities
{ {
return allowed.Contains(ChannelId); return allowed.Contains(ChannelId);
} }
else
{
var collectionFolders = LibraryManager.GetCollectionFolders(this, allCollectionFolders); var collectionFolders = LibraryManager.GetCollectionFolders(this, allCollectionFolders);
foreach (var folder in collectionFolders) foreach (var folder in collectionFolders)
@ -812,7 +811,6 @@ namespace MediaBrowser.Controller.Entities
return true; return true;
} }
} }
}
return false; return false;
} }

View File

@ -197,11 +197,9 @@ namespace MediaBrowser.Controller.LiveTv
{ {
return 2.0 / 3; return 2.0 / 3;
} }
else
{
return 16.0 / 9; return 16.0 / 9;
} }
}
public override string GetClientTypeName() public override string GetClientTypeName()
{ {

View File

@ -557,7 +557,8 @@ namespace MediaBrowser.Controller.MediaEncoding
{ {
return Array.FindIndex(_videoProfilesH264, x => string.Equals(x, profile, StringComparison.OrdinalIgnoreCase)); return Array.FindIndex(_videoProfilesH264, x => string.Equals(x, profile, StringComparison.OrdinalIgnoreCase));
} }
else if (string.Equals("hevc", videoCodec, StringComparison.OrdinalIgnoreCase))
if (string.Equals("hevc", videoCodec, StringComparison.OrdinalIgnoreCase))
{ {
return Array.FindIndex(_videoProfilesH265, x => string.Equals(x, profile, StringComparison.OrdinalIgnoreCase)); return Array.FindIndex(_videoProfilesH265, x => string.Equals(x, profile, StringComparison.OrdinalIgnoreCase));
} }
@ -1109,20 +1110,20 @@ namespace MediaBrowser.Controller.MediaEncoding
{ {
return "-bsf:v h264_mp4toannexb"; return "-bsf:v h264_mp4toannexb";
} }
else if (IsH265(stream))
if (IsH265(stream))
{ {
return "-bsf:v hevc_mp4toannexb"; return "-bsf:v hevc_mp4toannexb";
} }
else if (IsAAC(stream))
if (IsAAC(stream))
{ {
// Convert adts header(mpegts) to asc header(mp4). // Convert adts header(mpegts) to asc header(mp4).
return "-bsf:a aac_adtstoasc"; return "-bsf:a aac_adtstoasc";
} }
else
{
return null; return null;
} }
}
public static string GetAudioBitStreamArguments(EncodingJobInfo state, string segmentContainer, string mediaSourceContainer) public static string GetAudioBitStreamArguments(EncodingJobInfo state, string segmentContainer, string mediaSourceContainer)
{ {
@ -1199,11 +1200,9 @@ namespace MediaBrowser.Controller.MediaEncoding
{ {
return FormattableString.Invariant($" -rc_mode CBR -b:v {bitrate} -maxrate {bitrate} -bufsize {bufsize}"); return FormattableString.Invariant($" -rc_mode CBR -b:v {bitrate} -maxrate {bitrate} -bufsize {bufsize}");
} }
else
{
return FormattableString.Invariant($" -rc_mode VBR -b:v {bitrate} -maxrate {bitrate} -bufsize {bufsize}"); return FormattableString.Invariant($" -rc_mode VBR -b:v {bitrate} -maxrate {bitrate} -bufsize {bufsize}");
} }
}
return FormattableString.Invariant($" -b:v {bitrate} -maxrate {bitrate} -bufsize {bufsize}"); return FormattableString.Invariant($" -b:v {bitrate} -maxrate {bitrate} -bufsize {bufsize}");
} }
@ -2762,14 +2761,13 @@ namespace MediaBrowser.Controller.MediaEncoding
widthParam, widthParam,
heightParam); heightParam);
} }
else
{
return GetFixedSwScaleFilter(threedFormat, requestedWidth.Value, requestedHeight.Value); return GetFixedSwScaleFilter(threedFormat, requestedWidth.Value, requestedHeight.Value);
} }
}
// If Max dimensions were supplied, for width selects lowest even number between input width and width req size and selects lowest even number from in width*display aspect and requested size // If Max dimensions were supplied, for width selects lowest even number between input width and width req size and selects lowest even number from in width*display aspect and requested size
else if (requestedMaxWidth.HasValue && requestedMaxHeight.HasValue)
if (requestedMaxWidth.HasValue && requestedMaxHeight.HasValue)
{ {
var maxWidthParam = requestedMaxWidth.Value.ToString(CultureInfo.InvariantCulture); var maxWidthParam = requestedMaxWidth.Value.ToString(CultureInfo.InvariantCulture);
var maxHeightParam = requestedMaxHeight.Value.ToString(CultureInfo.InvariantCulture); var maxHeightParam = requestedMaxHeight.Value.ToString(CultureInfo.InvariantCulture);
@ -2783,15 +2781,14 @@ namespace MediaBrowser.Controller.MediaEncoding
} }
// If a fixed width was requested // If a fixed width was requested
else if (requestedWidth.HasValue) if (requestedWidth.HasValue)
{ {
if (threedFormat.HasValue) if (threedFormat.HasValue)
{ {
// This method can handle 0 being passed in for the requested height // This method can handle 0 being passed in for the requested height
return GetFixedSwScaleFilter(threedFormat, requestedWidth.Value, 0); return GetFixedSwScaleFilter(threedFormat, requestedWidth.Value, 0);
} }
else
{
var widthParam = requestedWidth.Value.ToString(CultureInfo.InvariantCulture); var widthParam = requestedWidth.Value.ToString(CultureInfo.InvariantCulture);
return string.Format( return string.Format(
@ -2799,10 +2796,9 @@ namespace MediaBrowser.Controller.MediaEncoding
"scale={0}:trunc(ow/a/2)*2", "scale={0}:trunc(ow/a/2)*2",
widthParam); widthParam);
} }
}
// If a fixed height was requested // If a fixed height was requested
else if (requestedHeight.HasValue) if (requestedHeight.HasValue)
{ {
var heightParam = requestedHeight.Value.ToString(CultureInfo.InvariantCulture); var heightParam = requestedHeight.Value.ToString(CultureInfo.InvariantCulture);
@ -2814,7 +2810,7 @@ namespace MediaBrowser.Controller.MediaEncoding
} }
// If a max width was requested // If a max width was requested
else if (requestedMaxWidth.HasValue) if (requestedMaxWidth.HasValue)
{ {
var maxWidthParam = requestedMaxWidth.Value.ToString(CultureInfo.InvariantCulture); var maxWidthParam = requestedMaxWidth.Value.ToString(CultureInfo.InvariantCulture);
@ -2826,7 +2822,7 @@ namespace MediaBrowser.Controller.MediaEncoding
} }
// If a max height was requested // If a max height was requested
else if (requestedMaxHeight.HasValue) if (requestedMaxHeight.HasValue)
{ {
var maxHeightParam = requestedMaxHeight.Value.ToString(CultureInfo.InvariantCulture); var maxHeightParam = requestedMaxHeight.Value.ToString(CultureInfo.InvariantCulture);
@ -2908,18 +2904,21 @@ namespace MediaBrowser.Controller.MediaEncoding
"yadif_cuda={0}:-1:0", "yadif_cuda={0}:-1:0",
doubleRateDeint ? "1" : "0"); doubleRateDeint ? "1" : "0");
} }
else if (hwDeintSuffix.Contains("vaapi", StringComparison.OrdinalIgnoreCase))
if (hwDeintSuffix.Contains("vaapi", StringComparison.OrdinalIgnoreCase))
{ {
return string.Format( return string.Format(
CultureInfo.InvariantCulture, CultureInfo.InvariantCulture,
"deinterlace_vaapi=rate={0}", "deinterlace_vaapi=rate={0}",
doubleRateDeint ? "field" : "frame"); doubleRateDeint ? "field" : "frame");
} }
else if (hwDeintSuffix.Contains("qsv", StringComparison.OrdinalIgnoreCase))
if (hwDeintSuffix.Contains("qsv", StringComparison.OrdinalIgnoreCase))
{ {
return "deinterlace_qsv=mode=2"; return "deinterlace_qsv=mode=2";
} }
else if (hwDeintSuffix.Contains("videotoolbox", StringComparison.OrdinalIgnoreCase))
if (hwDeintSuffix.Contains("videotoolbox", StringComparison.OrdinalIgnoreCase))
{ {
return string.Format( return string.Format(
CultureInfo.InvariantCulture, CultureInfo.InvariantCulture,
@ -2950,7 +2949,8 @@ namespace MediaBrowser.Controller.MediaEncoding
options.VppTonemappingBrightness, options.VppTonemappingBrightness,
options.VppTonemappingContrast); options.VppTonemappingContrast);
} }
else if (string.Equals(hwTonemapSuffix, "vulkan", StringComparison.OrdinalIgnoreCase))
if (string.Equals(hwTonemapSuffix, "vulkan", StringComparison.OrdinalIgnoreCase))
{ {
args = "libplacebo=format={1}:tonemapping={2}:color_primaries=bt709:color_trc=bt709:colorspace=bt709:peak_detect=0:upscaler=none:downscaler=none"; args = "libplacebo=format={1}:tonemapping={2}:color_primaries=bt709:color_trc=bt709:colorspace=bt709:peak_detect=0:upscaler=none:downscaler=none";
@ -4826,27 +4826,28 @@ namespace MediaBrowser.Controller.MediaEncoding
{ {
return videoStream.BitDepth.Value; return videoStream.BitDepth.Value;
} }
else if (string.Equals(videoStream.PixelFormat, "yuv420p", StringComparison.OrdinalIgnoreCase)
if (string.Equals(videoStream.PixelFormat, "yuv420p", StringComparison.OrdinalIgnoreCase)
|| string.Equals(videoStream.PixelFormat, "yuvj420p", StringComparison.OrdinalIgnoreCase) || string.Equals(videoStream.PixelFormat, "yuvj420p", StringComparison.OrdinalIgnoreCase)
|| string.Equals(videoStream.PixelFormat, "yuv444p", StringComparison.OrdinalIgnoreCase)) || string.Equals(videoStream.PixelFormat, "yuv444p", StringComparison.OrdinalIgnoreCase))
{ {
return 8; return 8;
} }
else if (string.Equals(videoStream.PixelFormat, "yuv420p10le", StringComparison.OrdinalIgnoreCase)
if (string.Equals(videoStream.PixelFormat, "yuv420p10le", StringComparison.OrdinalIgnoreCase)
|| string.Equals(videoStream.PixelFormat, "yuv444p10le", StringComparison.OrdinalIgnoreCase)) || string.Equals(videoStream.PixelFormat, "yuv444p10le", StringComparison.OrdinalIgnoreCase))
{ {
return 10; return 10;
} }
else if (string.Equals(videoStream.PixelFormat, "yuv420p12le", StringComparison.OrdinalIgnoreCase)
if (string.Equals(videoStream.PixelFormat, "yuv420p12le", StringComparison.OrdinalIgnoreCase)
|| string.Equals(videoStream.PixelFormat, "yuv444p12le", StringComparison.OrdinalIgnoreCase)) || string.Equals(videoStream.PixelFormat, "yuv444p12le", StringComparison.OrdinalIgnoreCase))
{ {
return 12; return 12;
} }
else
{
return 8; return 8;
} }
}
return 0; return 0;
} }
@ -5077,13 +5078,11 @@ namespace MediaBrowser.Controller.MediaEncoding
return " -hwaccel cuda" + (outputHwSurface ? " -hwaccel_output_format cuda" : string.Empty) return " -hwaccel cuda" + (outputHwSurface ? " -hwaccel_output_format cuda" : string.Empty)
+ (nvdecNoInternalCopy ? " -hwaccel_flags +unsafe_output" : string.Empty) + " -threads 1" + (isAv1 ? " -c:v av1" : string.Empty); + (nvdecNoInternalCopy ? " -hwaccel_flags +unsafe_output" : string.Empty) + " -threads 1" + (isAv1 ? " -c:v av1" : string.Empty);
} }
else
{
// cuvid decoder doesn't have threading issue. // cuvid decoder doesn't have threading issue.
return " -hwaccel cuda" + (outputHwSurface ? " -hwaccel_output_format cuda" : string.Empty); return " -hwaccel cuda" + (outputHwSurface ? " -hwaccel_output_format cuda" : string.Empty);
} }
} }
}
// Amd d3d11va // Amd d3d11va
if (string.Equals(options.HardwareAccelerationType, "amf", StringComparison.OrdinalIgnoreCase)) if (string.Equals(options.HardwareAccelerationType, "amf", StringComparison.OrdinalIgnoreCase))
@ -5439,7 +5438,8 @@ namespace MediaBrowser.Controller.MediaEncoding
// Automatically set thread count // Automatically set thread count
return mustSetThreadCount ? Math.Max(Environment.ProcessorCount - 1, 1) : 0; return mustSetThreadCount ? Math.Max(Environment.ProcessorCount - 1, 1) : 0;
} }
else if (threads >= Environment.ProcessorCount)
if (threads >= Environment.ProcessorCount)
{ {
return Environment.ProcessorCount; return Environment.ProcessorCount;
} }

View File

@ -533,11 +533,9 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
_logger.LogWarning("Session {SessionId} is seeking to wrong position, correcting.", session.Id); _logger.LogWarning("Session {SessionId} is seeking to wrong position, correcting.", session.Id);
return; return;
} }
else
{
// Session is ready. // Session is ready.
context.SetBuffering(session, false); context.SetBuffering(session, false);
}
if (!context.IsBuffering()) if (!context.IsBuffering())
{ {

View File

@ -313,18 +313,14 @@ namespace MediaBrowser.Controller.SyncPlay.Queue
return true; return true;
} }
else
{
// Restoring playing item. // Restoring playing item.
SetPlayingItemByPlaylistId(playingItem.PlaylistItemId); SetPlayingItemByPlaylistId(playingItem.PlaylistItemId);
return false; return false;
} }
}
else
{
return false; return false;
} }
}
/// <summary> /// <summary>
/// Moves an item in the playlist to another position. /// Moves an item in the playlist to another position.
@ -528,11 +524,9 @@ namespace MediaBrowser.Controller.SyncPlay.Queue
{ {
return _shuffledPlaylist; return _shuffledPlaylist;
} }
else
{
return _sortedPlaylist; return _sortedPlaylist;
} }
}
/// <summary> /// <summary>
/// Gets the current playing item, depending on the shuffle mode. /// Gets the current playing item, depending on the shuffle mode.
@ -544,14 +538,13 @@ namespace MediaBrowser.Controller.SyncPlay.Queue
{ {
return null; return null;
} }
else if (ShuffleMode.Equals(GroupShuffleMode.Shuffle))
if (ShuffleMode.Equals(GroupShuffleMode.Shuffle))
{ {
return _shuffledPlaylist[PlayingItemIndex]; return _shuffledPlaylist[PlayingItemIndex];
} }
else
{
return _sortedPlaylist[PlayingItemIndex]; return _sortedPlaylist[PlayingItemIndex];
} }
} }
} }
}

View File

@ -231,11 +231,9 @@ namespace MediaBrowser.MediaEncoding.Attachments
throw new InvalidOperationException( throw new InvalidOperationException(
string.Format(CultureInfo.InvariantCulture, "ffmpeg attachment extraction failed for {0} to {1}", inputPath, outputPath)); string.Format(CultureInfo.InvariantCulture, "ffmpeg attachment extraction failed for {0} to {1}", inputPath, outputPath));
} }
else
{
_logger.LogInformation("ffmpeg attachment extraction completed for {InputPath} to {OutputPath}", inputPath, outputPath); _logger.LogInformation("ffmpeg attachment extraction completed for {InputPath} to {OutputPath}", inputPath, outputPath);
} }
}
private async Task<Stream> GetAttachmentStream( private async Task<Stream> GetAttachmentStream(
MediaSourceInfo mediaSource, MediaSourceInfo mediaSource,
@ -376,11 +374,9 @@ namespace MediaBrowser.MediaEncoding.Attachments
throw new InvalidOperationException( throw new InvalidOperationException(
string.Format(CultureInfo.InvariantCulture, "ffmpeg attachment extraction failed for {0} to {1}", inputPath, outputPath)); string.Format(CultureInfo.InvariantCulture, "ffmpeg attachment extraction failed for {0} to {1}", inputPath, outputPath));
} }
else
{
_logger.LogInformation("ffmpeg attachment extraction completed for {InputPath} to {OutputPath}", inputPath, outputPath); _logger.LogInformation("ffmpeg attachment extraction completed for {InputPath} to {OutputPath}", inputPath, outputPath);
} }
}
private string GetAttachmentCachePath(string mediaPath, MediaSourceInfo mediaSource, int attachmentStreamIndex) private string GetAttachmentCachePath(string mediaPath, MediaSourceInfo mediaSource, int attachmentStreamIndex)
{ {

View File

@ -217,12 +217,14 @@ namespace MediaBrowser.MediaEncoding.Encoder
return false; return false;
} }
else if (version < MinVersion) // Version is below what we recommend
if (version < MinVersion) // Version is below what we recommend
{ {
_logger.LogWarning("FFmpeg validation: The minimum recommended version is {MinVersion}", MinVersion); _logger.LogWarning("FFmpeg validation: The minimum recommended version is {MinVersion}", MinVersion);
return false; return false;
} }
else if (MaxVersion is not null && version > MaxVersion) // Version is above what we recommend
if (MaxVersion is not null && version > MaxVersion) // Version is above what we recommend
{ {
_logger.LogWarning("FFmpeg validation: The maximum recommended version is {MaxVersion}", MaxVersion); _logger.LogWarning("FFmpeg validation: The maximum recommended version is {MaxVersion}", MaxVersion);
return false; return false;

View File

@ -624,10 +624,8 @@ namespace MediaBrowser.MediaEncoding.Subtitles
throw new FfmpegException( throw new FfmpegException(
string.Format(CultureInfo.InvariantCulture, "ffmpeg subtitle extraction failed for {0} to {1}", inputPath, outputPath)); string.Format(CultureInfo.InvariantCulture, "ffmpeg subtitle extraction failed for {0} to {1}", inputPath, outputPath));
} }
else
{
_logger.LogInformation("ffmpeg subtitle extraction completed for {InputPath} to {OutputPath}", inputPath, outputPath); _logger.LogInformation("ffmpeg subtitle extraction completed for {InputPath} to {OutputPath}", inputPath, outputPath);
}
if (string.Equals(outputCodec, "ass", StringComparison.OrdinalIgnoreCase)) if (string.Equals(outputCodec, "ass", StringComparison.OrdinalIgnoreCase))
{ {

View File

@ -80,7 +80,8 @@ namespace MediaBrowser.Model.Cryptography
{ {
throw new FormatException("Hash string must contain a valid id"); throw new FormatException("Hash string must contain a valid id");
} }
else if (nextSegment == -1)
if (nextSegment == -1)
{ {
return new PasswordHash(hashString.ToString(), Array.Empty<byte>()); return new PasswordHash(hashString.ToString(), Array.Empty<byte>());
} }

View File

@ -1075,31 +1075,38 @@ namespace MediaBrowser.Model.Dlna
{ {
return 128000; return 128000;
} }
else if (totalBitrate <= 2000000)
if (totalBitrate <= 2000000)
{ {
return 384000; return 384000;
} }
else if (totalBitrate <= 3000000)
if (totalBitrate <= 3000000)
{ {
return 448000; return 448000;
} }
else if (totalBitrate <= 4000000)
if (totalBitrate <= 4000000)
{ {
return 640000; return 640000;
} }
else if (totalBitrate <= 5000000)
if (totalBitrate <= 5000000)
{ {
return 768000; return 768000;
} }
else if (totalBitrate <= 10000000)
if (totalBitrate <= 10000000)
{ {
return 1536000; return 1536000;
} }
else if (totalBitrate <= 15000000)
if (totalBitrate <= 15000000)
{ {
return 2304000; return 2304000;
} }
else if (totalBitrate <= 20000000)
if (totalBitrate <= 20000000)
{ {
return 3584000; return 3584000;
} }
@ -1443,7 +1450,8 @@ namespace MediaBrowser.Model.Dlna
{ {
return false; return false;
} }
else if (ContainerProfile.ContainsContainer(normalizedContainers, "mkv")
if (ContainerProfile.ContainsContainer(normalizedContainers, "mkv")
|| ContainerProfile.ContainsContainer(normalizedContainers, "matroska")) || ContainerProfile.ContainsContainer(normalizedContainers, "matroska"))
{ {
return true; return true;

View File

@ -17,11 +17,13 @@ namespace MediaBrowser.Model.MediaInfo
{ {
return "Dolby Digital"; return "Dolby Digital";
} }
else if (string.Equals(codec, "eac3", StringComparison.OrdinalIgnoreCase))
if (string.Equals(codec, "eac3", StringComparison.OrdinalIgnoreCase))
{ {
return "Dolby Digital+"; return "Dolby Digital+";
} }
else if (string.Equals(codec, "dca", StringComparison.OrdinalIgnoreCase))
if (string.Equals(codec, "dca", StringComparison.OrdinalIgnoreCase))
{ {
return "DTS"; return "DTS";
} }

View File

@ -221,10 +221,8 @@ namespace Rssdp.Infrastructure
{ {
return trimmedSegment.Substring(1, trimmedSegment.Length - 2); return trimmedSegment.Substring(1, trimmedSegment.Length - 2);
} }
else
{
return trimmedSegment; return trimmedSegment;
} }
} }
} }
}

View File

@ -171,11 +171,9 @@ namespace Rssdp
{ {
return "uuid:" + this.Uuid; return "uuid:" + this.Uuid;
} }
else
{
return _Udn; return _Udn;
} }
}
set set
{ {

View File

@ -585,11 +585,9 @@ namespace Rssdp.Infrastructure
{ {
return OneSecond; return OneSecond;
} }
else
{
return searchWaitTime.Subtract(OneSecond); return searchWaitTime.Subtract(OneSecond);
} }
}
private DiscoveredSsdpDevice FindExistingDeviceNotification(IEnumerable<DiscoveredSsdpDevice> devices, string notificationType, string usn) private DiscoveredSsdpDevice FindExistingDeviceNotification(IEnumerable<DiscoveredSsdpDevice> devices, string notificationType, string usn)
{ {

View File

@ -571,11 +571,9 @@ namespace Rssdp.Infrastructure
{ {
return nonzeroCacheLifetimesQuery.Min(); return nonzeroCacheLifetimesQuery.Min();
} }
else
{
return TimeSpan.Zero; return TimeSpan.Zero;
} }
}
private string GetFirstHeaderValue(System.Net.Http.Headers.HttpRequestHeaders httpRequestHeaders, string headerName) private string GetFirstHeaderValue(System.Net.Http.Headers.HttpRequestHeaders httpRequestHeaders, string headerName)
{ {

View File

@ -20,11 +20,13 @@ namespace Jellyfin.Extensions
{ {
return 0; return 0;
} }
else if (s1 is null)
if (s1 is null)
{ {
return -1; return -1;
} }
else if (s2 is null)
if (s2 is null)
{ {
return 1; return 1;
} }
@ -37,11 +39,13 @@ namespace Jellyfin.Extensions
{ {
return 0; return 0;
} }
else if (len1 == 0)
if (len1 == 0)
{ {
return -1; return -1;
} }
else if (len2 == 0)
if (len2 == 0)
{ {
return 1; return 1;
} }
@ -82,7 +86,8 @@ namespace Jellyfin.Extensions
{ {
return -1; return -1;
} }
else if (span1Len > span2Len)
if (span1Len > span2Len)
{ {
return 1; return 1;
} }