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();
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{
MemoryStreamProvider = new RecyclableMemoryStreamProvider();
}
else
{
MemoryStreamProvider = new MemoryStreamProvider();
}
OnLoggerLoaded(true);
LogManager.LoggerLoaded += (s, e) => OnLoggerLoaded(false);

View File

@ -1,15 +1,10 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using MediaBrowser.Common.IO;
using Microsoft.IO;
namespace MediaBrowser.Common.Implementations.IO
{
public class MemoryStreamProvider : IMemoryStreamProvider
public class RecyclableMemoryStreamProvider : IMemoryStreamProvider
{
readonly RecyclableMemoryStreamManager _manager = new RecyclableMemoryStreamManager();
@ -28,4 +23,22 @@ namespace MediaBrowser.Common.Implementations.IO
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();
if (string.Equals(collectionType, CollectionType.TvShows, StringComparison.OrdinalIgnoreCase))
{
if (args.ContainsFileSystemEntryByName("tvshow.nfo"))
{
return new Series
{
Path = args.Path,
Name = Path.GetFileName(args.Path)
};
}
//if (args.ContainsFileSystemEntryByName("tvshow.nfo"))
//{
// return new Series
// {
// Path = args.Path,
// Name = Path.GetFileName(args.Path)
// };
//}
var configuredContentType = _libraryManager.GetConfiguredContentType(args.Path);
if (!string.Equals(configuredContentType, CollectionType.TvShows, StringComparison.OrdinalIgnoreCase))