mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-16 22:13:06 +03:00
avoid buffering http responses
This commit is contained in:
@@ -9,6 +9,8 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
using CommonIO;
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Controller.IO;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
@@ -20,11 +22,13 @@ namespace MediaBrowser.MediaEncoding.Probing
|
||||
private readonly CultureInfo _usCulture = new CultureInfo("en-US");
|
||||
private readonly ILogger _logger;
|
||||
private readonly IFileSystem _fileSystem;
|
||||
private readonly IMemoryStreamProvider _memoryStreamProvider;
|
||||
|
||||
public ProbeResultNormalizer(ILogger logger, IFileSystem fileSystem)
|
||||
public ProbeResultNormalizer(ILogger logger, IFileSystem fileSystem, IMemoryStreamProvider memoryStreamProvider)
|
||||
{
|
||||
_logger = logger;
|
||||
_fileSystem = fileSystem;
|
||||
_memoryStreamProvider = memoryStreamProvider;
|
||||
}
|
||||
|
||||
public MediaInfo GetMediaInfo(InternalMediaInfoResult data, VideoType videoType, bool isAudio, string path, MediaProtocol protocol)
|
||||
@@ -187,7 +191,7 @@ namespace MediaBrowser.MediaEncoding.Probing
|
||||
xml = "<?xml version=\"1.0\"?>" + xml;
|
||||
|
||||
// <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>cast</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>name</key>\n\t\t\t<string>Blender Foundation</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>name</key>\n\t\t\t<string>Janus Bager Kristensen</string>\n\t\t</dict>\n\t</array>\n\t<key>directors</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>name</key>\n\t\t\t<string>Sacha Goedegebure</string>\n\t\t</dict>\n\t</array>\n\t<key>studio</key>\n\t<string>Blender Foundation</string>\n</dict>\n</plist>\n
|
||||
using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(xml)))
|
||||
using (var stream = _memoryStreamProvider.CreateNew(Encoding.UTF8.GetBytes(xml)))
|
||||
{
|
||||
using (var streamReader = new StreamReader(stream))
|
||||
{
|
||||
@@ -573,8 +577,7 @@ namespace MediaBrowser.MediaEncoding.Probing
|
||||
|
||||
private void NormalizeStreamTitle(MediaStream stream)
|
||||
{
|
||||
if (string.Equals(stream.Title, "sdh", StringComparison.OrdinalIgnoreCase) ||
|
||||
string.Equals(stream.Title, "cc", StringComparison.OrdinalIgnoreCase))
|
||||
if (string.Equals(stream.Title, "cc", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
stream.Title = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user