Merge pull request #2895 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2017-09-20 03:13:30 -04:00 committed by GitHub
commit 76adfd1f63
5 changed files with 85 additions and 10 deletions

View File

@ -2206,8 +2206,10 @@ namespace Emby.Server.Implementations
/// <returns>Task{CheckForUpdateResult}.</returns>
public async Task<CheckForUpdateResult> CheckForApplicationUpdate(CancellationToken cancellationToken, IProgress<double> progress)
{
var cacheLength = TimeSpan.FromMinutes(5);
var updateLevel = SystemUpdateLevel;
var cacheLength = updateLevel == PackageVersionClass.Release ?
TimeSpan.FromHours(4) :
TimeSpan.FromMinutes(5);
var result = await new GithubUpdater(HttpClient, JsonSerializer).CheckForUpdateResult("MediaBrowser",
"Emby",

View File

@ -4410,7 +4410,7 @@ namespace Emby.Server.Implementations.Data
index++;
}
whereClauses.Add(string.Join(" OR ", includeIds.ToArray()));
whereClauses.Add("(" + string.Join(" OR ", includeIds.ToArray()) + ")");
}
if (query.ExcludeItemIds.Length > 0)
{

View File

@ -50,7 +50,9 @@ namespace MediaBrowser.Controller.LiveTv
public static double? GetDefaultPrimaryImageAspectRatio(IHasProgramAttributes item)
{
var serviceName = item.ServiceName;
if (!item.IsMovie && !string.Equals(serviceName, EmbyServiceName, StringComparison.OrdinalIgnoreCase))
if (!item.IsMovie
&& !string.Equals(serviceName, EmbyServiceName, StringComparison.OrdinalIgnoreCase)
&& !string.Equals(serviceName, "Next Pvr", StringComparison.OrdinalIgnoreCase))
{
double value = 16;
value /= 9;

View File

@ -1,4 +1,7 @@
using System.Linq;
using System;
using System.IO;
using System.Linq;
using System.Text;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Movies;
@ -70,6 +73,17 @@ namespace MediaBrowser.XbmcMetadata.Parsers
{
movie.CollectionName = val;
}
else
{
try
{
ParseSetXml(val, movie);
}
catch (Exception ex)
{
Logger.ErrorException("Error parsing set node", ex);
}
}
}
break;
@ -109,6 +123,63 @@ namespace MediaBrowser.XbmcMetadata.Parsers
}
}
private void ParseSetXml(string xml, Movie movie)
{
using (var ms = new MemoryStream())
{
//xml = xml.Substring(xml.IndexOf('<'));
//xml = xml.Substring(0, xml.LastIndexOf('>'));
xml = "<set>" + xml + "</set>";
var bytes = Encoding.UTF8.GetBytes(xml);
ms.Write(bytes, 0, bytes.Length);
ms.Position = 0;
// These are not going to be valid xml so no sense in causing the provider to fail and spamming the log with exceptions
try
{
var settings = XmlReaderSettingsFactory.Create(false);
settings.CheckCharacters = false;
settings.IgnoreProcessingInstructions = true;
settings.IgnoreComments = true;
// Use XmlReader for best performance
using (var reader = XmlReader.Create(ms, settings))
{
reader.MoveToContent();
reader.Read();
// Loop through each element
while (!reader.EOF && reader.ReadState == ReadState.Interactive)
{
if (reader.NodeType == XmlNodeType.Element)
{
switch (reader.Name)
{
case "name":
movie.CollectionName = reader.ReadElementContentAsString();
break;
default:
reader.Skip();
break;
}
}
else
{
reader.Read();
}
}
}
}
catch (XmlException)
{
}
}
}
public MovieNfoParser(ILogger logger, IConfigurationManager config, IProviderManager providerManager, IFileSystem fileSystem, IXmlReaderSettingsFactory xmlReaderSettingsFactory) : base(logger, config, providerManager, fileSystem, xmlReaderSettingsFactory)
{
}

View File

@ -1,3 +1,3 @@
using System.Reflection;
[assembly: AssemblyVersion("3.2.30.26")]
[assembly: AssemblyVersion("3.2.30.27")]