Merge pull request #2232 from MediaBrowser/beta

Beta
pull/1154/head
Luke 8 years ago committed by GitHub
commit 3f438cdf7b

@ -81,7 +81,7 @@ namespace MediaBrowser.Api
info.ContentTypeOptions = GetContentTypeOptions(true); info.ContentTypeOptions = GetContentTypeOptions(true);
info.ContentType = configuredContentType; info.ContentType = configuredContentType;
if (string.Equals(inheritedContentType, CollectionType.TvShows, StringComparison.OrdinalIgnoreCase)) if (string.IsNullOrWhiteSpace(inheritedContentType) || string.Equals(inheritedContentType, CollectionType.TvShows, StringComparison.OrdinalIgnoreCase))
{ {
info.ContentTypeOptions = info.ContentTypeOptions info.ContentTypeOptions = info.ContentTypeOptions
.Where(i => string.IsNullOrWhiteSpace(i.Value) || string.Equals(i.Value, CollectionType.TvShows, StringComparison.OrdinalIgnoreCase)) .Where(i => string.IsNullOrWhiteSpace(i.Value) || string.Equals(i.Value, CollectionType.TvShows, StringComparison.OrdinalIgnoreCase))

@ -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);

@ -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);
}
}
} }

@ -1068,7 +1068,7 @@ namespace MediaBrowser.Controller.Entities
{ {
var result = new Dictionary<Guid, BaseItem>(); var result = new Dictionary<Guid, BaseItem>();
AddChildrenToList(result, true, true, filter); AddChildrenToList(result, includeLinkedChildren, true, filter);
return result.Values.ToList(); return result.Values.ToList();
} }

@ -4,7 +4,6 @@ namespace MediaBrowser.Model.LiveTv
public enum RecordingStatus public enum RecordingStatus
{ {
New, New,
Scheduled,
InProgress, InProgress,
Completed, Completed,
Cancelled, Cancelled,

@ -100,7 +100,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer
container.Adapter = _containerAdapter; container.Adapter = _containerAdapter;
Plugins.RemoveAll(x => x is NativeTypesFeature); Plugins.RemoveAll(x => x is NativeTypesFeature);
//Plugins.Add(new SwaggerFeature()); Plugins.Add(new SwaggerFeature());
Plugins.Add(new CorsFeature(allowedHeaders: "Content-Type, Authorization, Range, X-MediaBrowser-Token, X-Emby-Authorization")); Plugins.Add(new CorsFeature(allowedHeaders: "Content-Type, Authorization, Range, X-MediaBrowser-Token, X-Emby-Authorization"));
//Plugins.Add(new AuthFeature(() => new AuthUserSession(), new IAuthProvider[] { //Plugins.Add(new AuthFeature(() => new AuthUserSession(), new IAuthProvider[] {

@ -59,18 +59,18 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
return null; return null;
} }
if (args.ContainsFileSystemEntryByName("tvshow.nfo"))
{
return new Series
{
Path = args.Path,
Name = Path.GetFileName(args.Path)
};
}
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"))
//{
// return new Series
// {
// Path = 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))
{ {
@ -83,6 +83,15 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
} }
else if (string.IsNullOrWhiteSpace(collectionType)) else if (string.IsNullOrWhiteSpace(collectionType))
{ {
if (args.ContainsFileSystemEntryByName("tvshow.nfo"))
{
return new Series
{
Path = args.Path,
Name = Path.GetFileName(args.Path)
};
}
if (args.Parent.IsRoot) if (args.Parent.IsRoot)
{ {
return null; return null;

@ -761,6 +761,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
{ {
defaults.SeriesId = program.SeriesId; defaults.SeriesId = program.SeriesId;
defaults.ProgramId = program.Id; defaults.ProgramId = program.Id;
defaults.RecordNewOnly = !program.IsRepeat;
} }
defaults.SkipEpisodesInLibrary = true; defaults.SkipEpisodesInLibrary = true;

@ -112,8 +112,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts
} }
channel.ImageUrl = FindProperty("tvg-logo", extInf, null); channel.ImageUrl = FindProperty("tvg-logo", extInf, null);
channel.Number = FindProperty("tvg-id", extInf, channel.Number);
channel.Number = FindProperty("channel-id", extInf, channel.Number); channel.Number = FindProperty("channel-id", extInf, channel.Number);
channel.Number = FindProperty("tvg-id", extInf, channel.Number);
channel.Name = FindProperty("tvg-name", extInf, channel.Name); channel.Name = FindProperty("tvg-name", extInf, channel.Name);
channel.Name = FindProperty("tvg-id", extInf, channel.Name); channel.Name = FindProperty("tvg-id", extInf, channel.Name);
return channel; return channel;

@ -1309,7 +1309,7 @@ namespace MediaBrowser.Server.Startup.Common
EncoderLocationType = MediaEncoder.EncoderLocationType, EncoderLocationType = MediaEncoder.EncoderLocationType,
SystemArchitecture = NativeApp.Environment.SystemArchitecture, SystemArchitecture = NativeApp.Environment.SystemArchitecture,
SystemUpdateLevel = ConfigurationManager.CommonConfiguration.SystemUpdateLevel, SystemUpdateLevel = ConfigurationManager.CommonConfiguration.SystemUpdateLevel,
PackageName = _startupOptions.GetOption("package") PackageName = _startupOptions.GetOption("-package")
}; };
} }

Loading…
Cancel
Save