commit
1c169b5b40
|
@ -234,7 +234,14 @@ namespace MediaBrowser.Common.Implementations
|
||||||
|
|
||||||
JsonSerializer = CreateJsonSerializer();
|
JsonSerializer = CreateJsonSerializer();
|
||||||
|
|
||||||
|
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
|
||||||
|
{
|
||||||
|
MemoryStreamProvider = new RecyclableMemoryStreamProvider();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
MemoryStreamProvider = new MemoryStreamProvider();
|
MemoryStreamProvider = new MemoryStreamProvider();
|
||||||
|
}
|
||||||
|
|
||||||
OnLoggerLoaded(true);
|
OnLoggerLoaded(true);
|
||||||
LogManager.LoggerLoaded += (s, e) => OnLoggerLoaded(false);
|
LogManager.LoggerLoaded += (s, e) => OnLoggerLoaded(false);
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user