Merge pull request #2231 from MediaBrowser/dev

update images
This commit is contained in:
Luke 2016-10-13 17:14:17 -04:00 committed by GitHub
commit 1c169b5b40
3 changed files with 36 additions and 16 deletions

View File

@ -234,7 +234,14 @@ namespace MediaBrowser.Common.Implementations
JsonSerializer = CreateJsonSerializer(); JsonSerializer = CreateJsonSerializer();
MemoryStreamProvider = new MemoryStreamProvider(); if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{
MemoryStreamProvider = new RecyclableMemoryStreamProvider();
}
else
{
MemoryStreamProvider = new MemoryStreamProvider();
}
OnLoggerLoaded(true); OnLoggerLoaded(true);
LogManager.LoggerLoaded += (s, e) => OnLoggerLoaded(false); LogManager.LoggerLoaded += (s, e) => OnLoggerLoaded(false);

View File

@ -1,15 +1,10 @@
using System; using System.IO;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MediaBrowser.Common.IO; using MediaBrowser.Common.IO;
using Microsoft.IO; using Microsoft.IO;
namespace MediaBrowser.Common.Implementations.IO namespace MediaBrowser.Common.Implementations.IO
{ {
public class MemoryStreamProvider : IMemoryStreamProvider public class RecyclableMemoryStreamProvider : IMemoryStreamProvider
{ {
readonly RecyclableMemoryStreamManager _manager = new RecyclableMemoryStreamManager(); readonly RecyclableMemoryStreamManager _manager = new RecyclableMemoryStreamManager();
@ -28,4 +23,22 @@ namespace MediaBrowser.Common.Implementations.IO
return _manager.GetStream("RecyclableMemoryStream", buffer, 0, buffer.Length); return _manager.GetStream("RecyclableMemoryStream", buffer, 0, buffer.Length);
} }
} }
public class MemoryStreamProvider : IMemoryStreamProvider
{
public MemoryStream CreateNew()
{
return new MemoryStream();
}
public MemoryStream CreateNew(int capacity)
{
return new MemoryStream(capacity);
}
public MemoryStream CreateNew(byte[] buffer)
{
return new MemoryStream(buffer);
}
}
} }

View File

@ -62,14 +62,14 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
var collectionType = args.GetCollectionType(); var collectionType = args.GetCollectionType();
if (string.Equals(collectionType, CollectionType.TvShows, StringComparison.OrdinalIgnoreCase)) if (string.Equals(collectionType, CollectionType.TvShows, StringComparison.OrdinalIgnoreCase))
{ {
if (args.ContainsFileSystemEntryByName("tvshow.nfo")) //if (args.ContainsFileSystemEntryByName("tvshow.nfo"))
{ //{
return new Series // return new Series
{ // {
Path = args.Path, // Path = args.Path,
Name = Path.GetFileName(args.Path) // Name = Path.GetFileName(args.Path)
}; // };
} //}
var configuredContentType = _libraryManager.GetConfiguredContentType(args.Path); var configuredContentType = _libraryManager.GetConfiguredContentType(args.Path);
if (!string.Equals(configuredContentType, CollectionType.TvShows, StringComparison.OrdinalIgnoreCase)) if (!string.Equals(configuredContentType, CollectionType.TvShows, StringComparison.OrdinalIgnoreCase))