mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-02 13:58:29 +01:00
Merge remote-tracking branch 'upstream/master' into network-rewrite
This commit is contained in:
@@ -56,6 +56,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
".srt",
|
||||
".vtt",
|
||||
".sub",
|
||||
".sup",
|
||||
".idx",
|
||||
".txt",
|
||||
".edl",
|
||||
|
||||
@@ -1300,8 +1300,15 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <summary>
|
||||
/// Adds the children to list.
|
||||
/// </summary>
|
||||
private void AddChildren(User user, bool includeLinkedChildren, Dictionary<Guid, BaseItem> result, bool recursive, InternalItemsQuery query)
|
||||
private void AddChildren(User user, bool includeLinkedChildren, Dictionary<Guid, BaseItem> result, bool recursive, InternalItemsQuery query, HashSet<Folder> visitedFolders = null)
|
||||
{
|
||||
// Prevent infinite recursion of nested folders
|
||||
visitedFolders ??= new HashSet<Folder>();
|
||||
if (!visitedFolders.Add(this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// If Query.AlbumFolders is set, then enforce the format as per the db in that it permits sub-folders in music albums.
|
||||
IEnumerable<BaseItem> children = null;
|
||||
if ((query?.DisplayAlbumFolders ?? false) && (this is MusicAlbum))
|
||||
@@ -1316,42 +1323,33 @@ namespace MediaBrowser.Controller.Entities
|
||||
children = GetEligibleChildrenForRecursiveChildren(user);
|
||||
}
|
||||
|
||||
foreach (var child in children)
|
||||
{
|
||||
bool? isVisibleToUser = null;
|
||||
|
||||
if (query is null || UserViewBuilder.FilterItem(child, query))
|
||||
{
|
||||
isVisibleToUser = child.IsVisible(user);
|
||||
|
||||
if (isVisibleToUser.Value)
|
||||
{
|
||||
result[child.Id] = child;
|
||||
}
|
||||
}
|
||||
|
||||
if (isVisibleToUser ?? child.IsVisible(user))
|
||||
{
|
||||
if (recursive && child.IsFolder)
|
||||
{
|
||||
var folder = (Folder)child;
|
||||
|
||||
folder.AddChildren(user, includeLinkedChildren, result, true, query);
|
||||
}
|
||||
}
|
||||
}
|
||||
AddChildrenFromCollection(children, user, includeLinkedChildren, result, recursive, query, visitedFolders);
|
||||
|
||||
if (includeLinkedChildren)
|
||||
{
|
||||
foreach (var child in GetLinkedChildren(user))
|
||||
AddChildrenFromCollection(GetLinkedChildren(user), user, includeLinkedChildren, result, recursive, query, visitedFolders);
|
||||
}
|
||||
}
|
||||
|
||||
private void AddChildrenFromCollection(IEnumerable<BaseItem> children, User user, bool includeLinkedChildren, Dictionary<Guid, BaseItem> result, bool recursive, InternalItemsQuery query, HashSet<Folder> visitedFolders)
|
||||
{
|
||||
foreach (var child in children)
|
||||
{
|
||||
if (!child.IsVisible(user))
|
||||
{
|
||||
if (query is null || UserViewBuilder.FilterItem(child, query))
|
||||
{
|
||||
if (child.IsVisible(user))
|
||||
{
|
||||
result[child.Id] = child;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (query is null || UserViewBuilder.FilterItem(child, query))
|
||||
{
|
||||
result[child.Id] = child;
|
||||
}
|
||||
|
||||
if (recursive && child.IsFolder)
|
||||
{
|
||||
var folder = (Folder)child;
|
||||
|
||||
folder.AddChildren(user, includeLinkedChildren, result, true, query, visitedFolders);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,7 +320,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
|
||||
if (!IsLocked)
|
||||
{
|
||||
if (SourceType == SourceType.Library)
|
||||
if (SourceType == SourceType.Library || SourceType == SourceType.LiveTV)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.2" />
|
||||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
|
||||
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="7.0.0" />
|
||||
</ItemGroup>
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
<!-- Code Analyzers-->
|
||||
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.3">
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
||||
@@ -938,8 +938,10 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
&& state.SubtitleStream.IsExternal)
|
||||
{
|
||||
var subtitlePath = state.SubtitleStream.Path;
|
||||
var subtitleExtension = Path.GetExtension(subtitlePath);
|
||||
|
||||
if (string.Equals(Path.GetExtension(subtitlePath), ".sub", StringComparison.OrdinalIgnoreCase))
|
||||
if (string.Equals(subtitleExtension, ".sub", StringComparison.OrdinalIgnoreCase)
|
||||
|| string.Equals(subtitleExtension, ".sup", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var idxFile = Path.ChangeExtension(subtitlePath, ".idx");
|
||||
if (File.Exists(idxFile))
|
||||
@@ -2127,15 +2129,30 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
|
||||
var filters = new List<string>();
|
||||
|
||||
// Boost volume to 200% when downsampling from 6ch to 2ch
|
||||
if (channels.HasValue
|
||||
&& channels.Value <= 2
|
||||
&& channels.Value == 2
|
||||
&& state.AudioStream is not null
|
||||
&& state.AudioStream.Channels.HasValue
|
||||
&& state.AudioStream.Channels.Value > 5
|
||||
&& !encodingOptions.DownMixAudioBoost.Equals(1))
|
||||
&& state.AudioStream.Channels.Value > 5)
|
||||
{
|
||||
filters.Add("volume=" + encodingOptions.DownMixAudioBoost.ToString(CultureInfo.InvariantCulture));
|
||||
switch (encodingOptions.DownMixStereoAlgorithm)
|
||||
{
|
||||
case DownMixStereoAlgorithms.Dave750:
|
||||
filters.Add("volume=4.25");
|
||||
filters.Add("pan=stereo|c0=0.5*c2+0.707*c0+0.707*c4+0.5*c3|c1=0.5*c2+0.707*c1+0.707*c5+0.5*c3");
|
||||
break;
|
||||
case DownMixStereoAlgorithms.NightmodeDialogue:
|
||||
filters.Add("pan=stereo|c0=c2+0.30*c0+0.30*c4|c1=c2+0.30*c1+0.30*c5");
|
||||
break;
|
||||
case DownMixStereoAlgorithms.None:
|
||||
default:
|
||||
if (!encodingOptions.DownMixAudioBoost.Equals(1))
|
||||
{
|
||||
filters.Add("volume=" + encodingOptions.DownMixAudioBoost.ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var isCopyingTimestamps = state.CopyTimestamps || state.TranscodingType != TranscodingJobType.Progressive;
|
||||
@@ -5709,10 +5726,9 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
return args;
|
||||
}
|
||||
|
||||
// Add the number of audio channels
|
||||
var channels = state.OutputAudioChannels;
|
||||
|
||||
if (channels.HasValue)
|
||||
if (channels.HasValue && ((channels.Value != 2 && state.AudioStream.Channels <= 5) || encodingOptions.DownMixStereoAlgorithm == DownMixStereoAlgorithms.None))
|
||||
{
|
||||
args += " -ac " + channels.Value;
|
||||
}
|
||||
|
||||
@@ -57,16 +57,6 @@ namespace MediaBrowser.Controller.Session
|
||||
/// </summary>
|
||||
event EventHandler<SessionEventArgs> CapabilitiesChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when [authentication failed].
|
||||
/// </summary>
|
||||
event EventHandler<GenericEventArgs<AuthenticationRequest>> AuthenticationFailed;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when [authentication succeeded].
|
||||
/// </summary>
|
||||
event EventHandler<GenericEventArgs<AuthenticationResult>> AuthenticationSucceeded;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the sessions.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user