mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-06-29 02:13:36 +02:00
Remove redundant 'else' keywords
This commit is contained in:
parent
b6cfdb8b92
commit
910617bbc3
|
@ -1309,7 +1309,8 @@ namespace Emby.Server.Implementations.Data
|
|||
{
|
||||
return false;
|
||||
}
|
||||
else if (type == typeof(UserRootFolder))
|
||||
|
||||
if (type == typeof(UserRootFolder))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -1319,55 +1320,68 @@ namespace Emby.Server.Implementations.Data
|
|||
{
|
||||
return false;
|
||||
}
|
||||
else if (type == typeof(MusicArtist))
|
||||
|
||||
if (type == typeof(MusicArtist))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (type == typeof(Person))
|
||||
|
||||
if (type == typeof(Person))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (type == typeof(MusicGenre))
|
||||
|
||||
if (type == typeof(MusicGenre))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (type == typeof(Genre))
|
||||
|
||||
if (type == typeof(Genre))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (type == typeof(Studio))
|
||||
|
||||
if (type == typeof(Studio))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (type == typeof(PlaylistsFolder))
|
||||
|
||||
if (type == typeof(PlaylistsFolder))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (type == typeof(PhotoAlbum))
|
||||
|
||||
if (type == typeof(PhotoAlbum))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (type == typeof(Year))
|
||||
|
||||
if (type == typeof(Year))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (type == typeof(Book))
|
||||
|
||||
if (type == typeof(Book))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (type == typeof(LiveTvProgram))
|
||||
|
||||
if (type == typeof(LiveTvProgram))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (type == typeof(AudioBook))
|
||||
|
||||
if (type == typeof(AudioBook))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (type == typeof(Audio))
|
||||
|
||||
if (type == typeof(Audio))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (type == typeof(MusicAlbum))
|
||||
|
||||
if (type == typeof(MusicAlbum))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -78,7 +78,8 @@ namespace Emby.Server.Implementations.Library.Resolvers
|
|||
Set3DFormat(videoTmp);
|
||||
return videoTmp;
|
||||
}
|
||||
else if (IsBluRayDirectory(filename))
|
||||
|
||||
if (IsBluRayDirectory(filename))
|
||||
{
|
||||
var videoTmp = new TVideoType
|
||||
{
|
||||
|
|
|
@ -627,11 +627,9 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
|||
_timerProvider.Update(existingTimer);
|
||||
return Task.FromResult(existingTimer.Id);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
throw new ArgumentException("A scheduled recording already exists for this program.");
|
||||
}
|
||||
}
|
||||
|
||||
info.Id = Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture);
|
||||
|
||||
|
|
|
@ -415,15 +415,14 @@ namespace Emby.Server.Implementations.LiveTv.Listings
|
|||
{
|
||||
return null;
|
||||
}
|
||||
else if (uri.IndexOf("http", StringComparison.OrdinalIgnoreCase) != -1)
|
||||
|
||||
if (uri.IndexOf("http", StringComparison.OrdinalIgnoreCase) != -1)
|
||||
{
|
||||
return uri;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return apiUrl + "/image/" + uri + "?token=" + token;
|
||||
}
|
||||
}
|
||||
|
||||
private static double GetAspectRatio(ImageDataDto i)
|
||||
{
|
||||
|
|
|
@ -620,11 +620,9 @@ namespace Emby.Server.Implementations.SyncPlay
|
|||
RestartCurrentItem();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool PreviousItemInQueue()
|
||||
|
@ -637,11 +635,9 @@ namespace Emby.Server.Implementations.SyncPlay
|
|||
RestartCurrentItem();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void SetRepeatMode(GroupRepeatMode mode)
|
||||
|
|
|
@ -339,11 +339,9 @@ namespace Emby.Server.Implementations.SyncPlay
|
|||
{
|
||||
return sessionsCounter > 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Releases unmanaged and optionally managed resources.
|
||||
|
|
|
@ -533,11 +533,9 @@ public class SubtitleController : BaseJellyfinApiController
|
|||
_logger.LogDebug("Fallback font size is {FileSize} Bytes", fileSize);
|
||||
return PhysicalFile(fontFile.FullName, MimeTypes.GetMimeType(fontFile.FullName));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
_logger.LogWarning("The selected font is null or empty");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.LogWarning("The path of fallback font folder has not been set");
|
||||
|
|
|
@ -500,11 +500,9 @@ namespace Jellyfin.Networking.Manager
|
|||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return address.IsPrivateAddressRange();
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsExcludedInterface(IPAddress address)
|
||||
|
@ -1171,13 +1169,15 @@ namespace Jellyfin.Networking.Manager
|
|||
bindPreference = addr.Value;
|
||||
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.
|
||||
bindPreference = addr.Value;
|
||||
break;
|
||||
}
|
||||
else if (addr.Key.Contains(source))
|
||||
|
||||
if (addr.Key.Contains(source))
|
||||
{
|
||||
// Match ip address.
|
||||
bindPreference = addr.Value;
|
||||
|
|
|
@ -801,8 +801,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
{
|
||||
return allowed.Contains(ChannelId);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
var collectionFolders = LibraryManager.GetCollectionFolders(this, allCollectionFolders);
|
||||
|
||||
foreach (var folder in collectionFolders)
|
||||
|
@ -812,7 +811,6 @@ namespace MediaBrowser.Controller.Entities
|
|||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -197,11 +197,9 @@ namespace MediaBrowser.Controller.LiveTv
|
|||
{
|
||||
return 2.0 / 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return 16.0 / 9;
|
||||
}
|
||||
}
|
||||
|
||||
public override string GetClientTypeName()
|
||||
{
|
||||
|
|
|
@ -557,7 +557,8 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||
{
|
||||
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));
|
||||
}
|
||||
|
@ -1109,20 +1110,20 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||
{
|
||||
return "-bsf:v h264_mp4toannexb";
|
||||
}
|
||||
else if (IsH265(stream))
|
||||
|
||||
if (IsH265(stream))
|
||||
{
|
||||
return "-bsf:v hevc_mp4toannexb";
|
||||
}
|
||||
else if (IsAAC(stream))
|
||||
|
||||
if (IsAAC(stream))
|
||||
{
|
||||
// Convert adts header(mpegts) to asc header(mp4).
|
||||
return "-bsf:a aac_adtstoasc";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
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}");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return FormattableString.Invariant($" -rc_mode VBR -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,
|
||||
heightParam);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
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
|
||||
else if (requestedMaxWidth.HasValue && requestedMaxHeight.HasValue)
|
||||
|
||||
if (requestedMaxWidth.HasValue && requestedMaxHeight.HasValue)
|
||||
{
|
||||
var maxWidthParam = requestedMaxWidth.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
|
||||
else if (requestedWidth.HasValue)
|
||||
if (requestedWidth.HasValue)
|
||||
{
|
||||
if (threedFormat.HasValue)
|
||||
{
|
||||
// This method can handle 0 being passed in for the requested height
|
||||
return GetFixedSwScaleFilter(threedFormat, requestedWidth.Value, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
var widthParam = requestedWidth.Value.ToString(CultureInfo.InvariantCulture);
|
||||
|
||||
return string.Format(
|
||||
|
@ -2799,10 +2796,9 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||
"scale={0}:trunc(ow/a/2)*2",
|
||||
widthParam);
|
||||
}
|
||||
}
|
||||
|
||||
// If a fixed height was requested
|
||||
else if (requestedHeight.HasValue)
|
||||
if (requestedHeight.HasValue)
|
||||
{
|
||||
var heightParam = requestedHeight.Value.ToString(CultureInfo.InvariantCulture);
|
||||
|
||||
|
@ -2814,7 +2810,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||
}
|
||||
|
||||
// If a max width was requested
|
||||
else if (requestedMaxWidth.HasValue)
|
||||
if (requestedMaxWidth.HasValue)
|
||||
{
|
||||
var maxWidthParam = requestedMaxWidth.Value.ToString(CultureInfo.InvariantCulture);
|
||||
|
||||
|
@ -2826,7 +2822,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||
}
|
||||
|
||||
// If a max height was requested
|
||||
else if (requestedMaxHeight.HasValue)
|
||||
if (requestedMaxHeight.HasValue)
|
||||
{
|
||||
var maxHeightParam = requestedMaxHeight.Value.ToString(CultureInfo.InvariantCulture);
|
||||
|
||||
|
@ -2908,18 +2904,21 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||
"yadif_cuda={0}:-1:0",
|
||||
doubleRateDeint ? "1" : "0");
|
||||
}
|
||||
else if (hwDeintSuffix.Contains("vaapi", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
if (hwDeintSuffix.Contains("vaapi", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"deinterlace_vaapi=rate={0}",
|
||||
doubleRateDeint ? "field" : "frame");
|
||||
}
|
||||
else if (hwDeintSuffix.Contains("qsv", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
if (hwDeintSuffix.Contains("qsv", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "deinterlace_qsv=mode=2";
|
||||
}
|
||||
else if (hwDeintSuffix.Contains("videotoolbox", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
if (hwDeintSuffix.Contains("videotoolbox", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
|
@ -2950,7 +2949,8 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||
options.VppTonemappingBrightness,
|
||||
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";
|
||||
|
||||
|
@ -4826,27 +4826,28 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||
{
|
||||
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, "yuv444p", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
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))
|
||||
{
|
||||
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))
|
||||
{
|
||||
return 12;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return 8;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -5077,13 +5078,11 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||
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);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// cuvid decoder doesn't have threading issue.
|
||||
return " -hwaccel cuda" + (outputHwSurface ? " -hwaccel_output_format cuda" : string.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Amd d3d11va
|
||||
if (string.Equals(options.HardwareAccelerationType, "amf", StringComparison.OrdinalIgnoreCase))
|
||||
|
@ -5439,7 +5438,8 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||
// Automatically set thread count
|
||||
return mustSetThreadCount ? Math.Max(Environment.ProcessorCount - 1, 1) : 0;
|
||||
}
|
||||
else if (threads >= Environment.ProcessorCount)
|
||||
|
||||
if (threads >= Environment.ProcessorCount)
|
||||
{
|
||||
return Environment.ProcessorCount;
|
||||
}
|
||||
|
|
|
@ -533,11 +533,9 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
_logger.LogWarning("Session {SessionId} is seeking to wrong position, correcting.", session.Id);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// Session is ready.
|
||||
context.SetBuffering(session, false);
|
||||
}
|
||||
|
||||
if (!context.IsBuffering())
|
||||
{
|
||||
|
|
|
@ -313,18 +313,14 @@ namespace MediaBrowser.Controller.SyncPlay.Queue
|
|||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// Restoring playing item.
|
||||
SetPlayingItemByPlaylistId(playingItem.PlaylistItemId);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Moves an item in the playlist to another position.
|
||||
|
@ -528,11 +524,9 @@ namespace MediaBrowser.Controller.SyncPlay.Queue
|
|||
{
|
||||
return _shuffledPlaylist;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return _sortedPlaylist;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current playing item, depending on the shuffle mode.
|
||||
|
@ -544,14 +538,13 @@ namespace MediaBrowser.Controller.SyncPlay.Queue
|
|||
{
|
||||
return null;
|
||||
}
|
||||
else if (ShuffleMode.Equals(GroupShuffleMode.Shuffle))
|
||||
|
||||
if (ShuffleMode.Equals(GroupShuffleMode.Shuffle))
|
||||
{
|
||||
return _shuffledPlaylist[PlayingItemIndex];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return _sortedPlaylist[PlayingItemIndex];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -231,11 +231,9 @@ namespace MediaBrowser.MediaEncoding.Attachments
|
|||
throw new InvalidOperationException(
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<Stream> GetAttachmentStream(
|
||||
MediaSourceInfo mediaSource,
|
||||
|
@ -376,11 +374,9 @@ namespace MediaBrowser.MediaEncoding.Attachments
|
|||
throw new InvalidOperationException(
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
private string GetAttachmentCachePath(string mediaPath, MediaSourceInfo mediaSource, int attachmentStreamIndex)
|
||||
{
|
||||
|
|
|
@ -217,12 +217,14 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||
|
||||
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);
|
||||
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);
|
||||
return false;
|
||||
|
|
|
@ -624,10 +624,8 @@ namespace MediaBrowser.MediaEncoding.Subtitles
|
|||
throw new FfmpegException(
|
||||
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);
|
||||
}
|
||||
|
||||
if (string.Equals(outputCodec, "ass", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
|
|
|
@ -80,7 +80,8 @@ namespace MediaBrowser.Model.Cryptography
|
|||
{
|
||||
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>());
|
||||
}
|
||||
|
|
|
@ -1075,31 +1075,38 @@ namespace MediaBrowser.Model.Dlna
|
|||
{
|
||||
return 128000;
|
||||
}
|
||||
else if (totalBitrate <= 2000000)
|
||||
|
||||
if (totalBitrate <= 2000000)
|
||||
{
|
||||
return 384000;
|
||||
}
|
||||
else if (totalBitrate <= 3000000)
|
||||
|
||||
if (totalBitrate <= 3000000)
|
||||
{
|
||||
return 448000;
|
||||
}
|
||||
else if (totalBitrate <= 4000000)
|
||||
|
||||
if (totalBitrate <= 4000000)
|
||||
{
|
||||
return 640000;
|
||||
}
|
||||
else if (totalBitrate <= 5000000)
|
||||
|
||||
if (totalBitrate <= 5000000)
|
||||
{
|
||||
return 768000;
|
||||
}
|
||||
else if (totalBitrate <= 10000000)
|
||||
|
||||
if (totalBitrate <= 10000000)
|
||||
{
|
||||
return 1536000;
|
||||
}
|
||||
else if (totalBitrate <= 15000000)
|
||||
|
||||
if (totalBitrate <= 15000000)
|
||||
{
|
||||
return 2304000;
|
||||
}
|
||||
else if (totalBitrate <= 20000000)
|
||||
|
||||
if (totalBitrate <= 20000000)
|
||||
{
|
||||
return 3584000;
|
||||
}
|
||||
|
@ -1443,7 +1450,8 @@ namespace MediaBrowser.Model.Dlna
|
|||
{
|
||||
return false;
|
||||
}
|
||||
else if (ContainerProfile.ContainsContainer(normalizedContainers, "mkv")
|
||||
|
||||
if (ContainerProfile.ContainsContainer(normalizedContainers, "mkv")
|
||||
|| ContainerProfile.ContainsContainer(normalizedContainers, "matroska"))
|
||||
{
|
||||
return true;
|
||||
|
|
|
@ -17,11 +17,13 @@ namespace MediaBrowser.Model.MediaInfo
|
|||
{
|
||||
return "Dolby Digital";
|
||||
}
|
||||
else if (string.Equals(codec, "eac3", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
if (string.Equals(codec, "eac3", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "Dolby Digital+";
|
||||
}
|
||||
else if (string.Equals(codec, "dca", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
if (string.Equals(codec, "dca", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "DTS";
|
||||
}
|
||||
|
|
|
@ -221,10 +221,8 @@ namespace Rssdp.Infrastructure
|
|||
{
|
||||
return trimmedSegment.Substring(1, trimmedSegment.Length - 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return trimmedSegment;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -171,11 +171,9 @@ namespace Rssdp
|
|||
{
|
||||
return "uuid:" + this.Uuid;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return _Udn;
|
||||
}
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
|
|
|
@ -585,11 +585,9 @@ namespace Rssdp.Infrastructure
|
|||
{
|
||||
return OneSecond;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return searchWaitTime.Subtract(OneSecond);
|
||||
}
|
||||
}
|
||||
|
||||
private DiscoveredSsdpDevice FindExistingDeviceNotification(IEnumerable<DiscoveredSsdpDevice> devices, string notificationType, string usn)
|
||||
{
|
||||
|
|
|
@ -571,11 +571,9 @@ namespace Rssdp.Infrastructure
|
|||
{
|
||||
return nonzeroCacheLifetimesQuery.Min();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return TimeSpan.Zero;
|
||||
}
|
||||
}
|
||||
|
||||
private string GetFirstHeaderValue(System.Net.Http.Headers.HttpRequestHeaders httpRequestHeaders, string headerName)
|
||||
{
|
||||
|
|
|
@ -20,11 +20,13 @@ namespace Jellyfin.Extensions
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
else if (s1 is null)
|
||||
|
||||
if (s1 is null)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
else if (s2 is null)
|
||||
|
||||
if (s2 is null)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
@ -37,11 +39,13 @@ namespace Jellyfin.Extensions
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
else if (len1 == 0)
|
||||
|
||||
if (len1 == 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
else if (len2 == 0)
|
||||
|
||||
if (len2 == 0)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
@ -82,7 +86,8 @@ namespace Jellyfin.Extensions
|
|||
{
|
||||
return -1;
|
||||
}
|
||||
else if (span1Len > span2Len)
|
||||
|
||||
if (span1Len > span2Len)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue