mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-20 09:04:42 +01:00
limit number of people in dlna responses
This commit is contained in:
@@ -2840,7 +2840,11 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
{
|
||||
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
|
||||
{
|
||||
return Directory.Exists(path);
|
||||
// We can't validate protocol-based paths, so just allow them
|
||||
if (path.IndexOf("://", StringComparison.OrdinalIgnoreCase) == -1)
|
||||
{
|
||||
return Directory.Exists(path);
|
||||
}
|
||||
}
|
||||
|
||||
// Without native support for unc, we cannot validate this when running under mono
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||
{
|
||||
var format = _liveTvOptions.RecordingEncodingFormat;
|
||||
|
||||
if (string.Equals(format, "mkv", StringComparison.OrdinalIgnoreCase))
|
||||
if (string.Equals(format, "mkv", StringComparison.OrdinalIgnoreCase) || _liveTvOptions.EnableOriginalVideoWithEncodedRecordings)
|
||||
{
|
||||
return "mkv";
|
||||
}
|
||||
@@ -204,6 +204,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||
|
||||
private bool EncodeVideo(MediaSourceInfo mediaSource)
|
||||
{
|
||||
if (_liveTvOptions.EnableOriginalAudioWithEncodedRecordings)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var mediaStreams = mediaSource.MediaStreams ?? new List<MediaStream>();
|
||||
return !mediaStreams.Any(i => i.Type == MediaStreamType.Video && string.Equals(i.Codec, "h264", StringComparison.OrdinalIgnoreCase) && !i.IsInterlaced);
|
||||
}
|
||||
|
||||
@@ -877,6 +877,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
SortOrder = query.SortOrder ?? SortOrder.Ascending,
|
||||
EnableTotalRecordCount = query.EnableTotalRecordCount,
|
||||
TopParentIds = new[] { topFolder.Id.ToString("N") },
|
||||
Name = query.Name,
|
||||
DtoOptions = options
|
||||
};
|
||||
|
||||
|
||||
@@ -111,15 +111,31 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts
|
||||
channel.Number = "0";
|
||||
}
|
||||
|
||||
channel.ImageUrl = FindProperty("tvg-logo", extInf, null);
|
||||
channel.Number = FindProperty("channel-id", extInf, channel.Number);
|
||||
channel.Number = FindProperty("tvg-id", extInf, channel.Number);
|
||||
channel.Name = FindProperty("tvg-id", extInf, channel.Name);
|
||||
channel.Name = FindProperty("tvg-name", extInf, channel.Name);
|
||||
channel.ImageUrl = FindProperty("tvg-logo", extInf);
|
||||
|
||||
var name = FindProperty("tvg-name", extInf);
|
||||
if (string.IsNullOrWhiteSpace(name))
|
||||
{
|
||||
name = FindProperty("tvg-id", extInf);
|
||||
}
|
||||
|
||||
channel.Name = name;
|
||||
|
||||
var numberString = FindProperty("tvg-id", extInf);
|
||||
if (string.IsNullOrWhiteSpace(numberString))
|
||||
{
|
||||
numberString = FindProperty("channel-id", extInf);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(numberString))
|
||||
{
|
||||
channel.Number = numberString;
|
||||
}
|
||||
|
||||
return channel;
|
||||
|
||||
}
|
||||
private string FindProperty(string property, string properties, string defaultResult = "")
|
||||
private string FindProperty(string property, string properties)
|
||||
{
|
||||
var reg = new Regex(@"([a-z0-9\-_]+)=\""([^""]+)\""", RegexOptions.IgnoreCase);
|
||||
var matches = reg.Matches(properties);
|
||||
@@ -130,7 +146,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts
|
||||
return match.Groups[2].Value;
|
||||
}
|
||||
}
|
||||
return defaultResult;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user