Merge pull request #5842 from BaronGreenback/optimization
Code Clean up: Group Methods
This commit is contained in:
commit
eeb5d4bd1e
|
@ -215,7 +215,7 @@ namespace Emby.Server.Implementations.Playlists
|
||||||
|
|
||||||
// Create a list of the new linked children to add to the playlist
|
// Create a list of the new linked children to add to the playlist
|
||||||
var childrenToAdd = newItems
|
var childrenToAdd = newItems
|
||||||
.Select(i => LinkedChild.Create(i))
|
.Select(LinkedChild.Create)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
// Log duplicates that have been ignored, if any
|
// Log duplicates that have been ignored, if any
|
||||||
|
|
|
@ -116,14 +116,14 @@ namespace Jellyfin.Api.Helpers
|
||||||
if (!string.IsNullOrWhiteSpace(streamingRequest.AudioCodec))
|
if (!string.IsNullOrWhiteSpace(streamingRequest.AudioCodec))
|
||||||
{
|
{
|
||||||
state.SupportedAudioCodecs = streamingRequest.AudioCodec.Split(',', StringSplitOptions.RemoveEmptyEntries);
|
state.SupportedAudioCodecs = streamingRequest.AudioCodec.Split(',', StringSplitOptions.RemoveEmptyEntries);
|
||||||
state.Request.AudioCodec = state.SupportedAudioCodecs.FirstOrDefault(i => mediaEncoder.CanEncodeToAudioCodec(i))
|
state.Request.AudioCodec = state.SupportedAudioCodecs.FirstOrDefault(mediaEncoder.CanEncodeToAudioCodec)
|
||||||
?? state.SupportedAudioCodecs.FirstOrDefault();
|
?? state.SupportedAudioCodecs.FirstOrDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(streamingRequest.SubtitleCodec))
|
if (!string.IsNullOrWhiteSpace(streamingRequest.SubtitleCodec))
|
||||||
{
|
{
|
||||||
state.SupportedSubtitleCodecs = streamingRequest.SubtitleCodec.Split(',', StringSplitOptions.RemoveEmptyEntries);
|
state.SupportedSubtitleCodecs = streamingRequest.SubtitleCodec.Split(',', StringSplitOptions.RemoveEmptyEntries);
|
||||||
state.Request.SubtitleCodec = state.SupportedSubtitleCodecs.FirstOrDefault(i => mediaEncoder.CanEncodeToSubtitleCodec(i))
|
state.Request.SubtitleCodec = state.SupportedSubtitleCodecs.FirstOrDefault(mediaEncoder.CanEncodeToSubtitleCodec)
|
||||||
?? state.SupportedSubtitleCodecs.FirstOrDefault();
|
?? state.SupportedSubtitleCodecs.FirstOrDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1067,7 +1067,7 @@ namespace Jellyfin.Networking.Manager
|
||||||
}
|
}
|
||||||
|
|
||||||
// Internal interfaces must be private, not excluded and part of the LocalNetworkSubnet.
|
// Internal interfaces must be private, not excluded and part of the LocalNetworkSubnet.
|
||||||
_internalInterfaces = CreateCollection(_interfaceAddresses.Where(i => IsInLocalNetwork(i)));
|
_internalInterfaces = CreateCollection(_interfaceAddresses.Where(IsInLocalNetwork));
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.LogInformation("Defined LAN addresses : {0}", _lanSubnets.AsString());
|
_logger.LogInformation("Defined LAN addresses : {0}", _lanSubnets.AsString());
|
||||||
|
|
|
@ -75,7 +75,7 @@ namespace Jellyfin.Server.Migrations.Routines
|
||||||
{
|
{
|
||||||
var existingConfigJson = JToken.Parse(File.ReadAllText(oldConfigPath));
|
var existingConfigJson = JToken.Parse(File.ReadAllText(oldConfigPath));
|
||||||
return _defaultConfigHistory
|
return _defaultConfigHistory
|
||||||
.Select(historicalConfigText => JToken.Parse(historicalConfigText))
|
.Select(JToken.Parse)
|
||||||
.Any(historicalConfigJson => JToken.DeepEquals(existingConfigJson, historicalConfigJson));
|
.Any(historicalConfigJson => JToken.DeepEquals(existingConfigJson, historicalConfigJson));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2324,7 +2324,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
.Where(i => i.IsLocalFile)
|
.Where(i => i.IsLocalFile)
|
||||||
.Select(i => System.IO.Path.GetDirectoryName(i.Path))
|
.Select(i => System.IO.Path.GetDirectoryName(i.Path))
|
||||||
.Distinct(StringComparer.OrdinalIgnoreCase)
|
.Distinct(StringComparer.OrdinalIgnoreCase)
|
||||||
.SelectMany(i => directoryService.GetFilePaths(i))
|
.SelectMany(directoryService.GetFilePaths)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
var deletedImages = ImageInfos
|
var deletedImages = ImageInfos
|
||||||
|
|
|
@ -57,7 +57,7 @@ namespace MediaBrowser.MediaEncoding.Probing
|
||||||
.Where(i => i.Type != MediaStreamType.Subtitle || !string.IsNullOrWhiteSpace(i.Codec))
|
.Where(i => i.Type != MediaStreamType.Subtitle || !string.IsNullOrWhiteSpace(i.Codec))
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
info.MediaAttachments = internalStreams.Select(s => GetMediaAttachment(s))
|
info.MediaAttachments = internalStreams.Select(GetMediaAttachment)
|
||||||
.Where(i => i != null)
|
.Where(i => i != null)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
|
|
|
@ -297,7 +297,7 @@ namespace MediaBrowser.Model.Dlna
|
||||||
int? inputAudioSampleRate = audioStream?.SampleRate;
|
int? inputAudioSampleRate = audioStream?.SampleRate;
|
||||||
int? inputAudioBitDepth = audioStream?.BitDepth;
|
int? inputAudioBitDepth = audioStream?.BitDepth;
|
||||||
|
|
||||||
if (directPlayMethods.Count() > 0)
|
if (directPlayMethods.Any())
|
||||||
{
|
{
|
||||||
string audioCodec = audioStream?.Codec;
|
string audioCodec = audioStream?.Codec;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user