support url's after closing nfo tag

This commit is contained in:
Luke Pulverenti 2014-10-20 23:41:11 -04:00
parent df509dedb7
commit a3d7849c26
5 changed files with 58 additions and 11 deletions

View File

@ -296,6 +296,16 @@ namespace MediaBrowser.Common.Implementations
logger.Info("64-Bit Process: {0}", Environment.Is64BitProcess);
logger.Info("Program data path: {0}", appPaths.ProgramDataPath);
Type type = Type.GetType("Mono.Runtime");
if (type != null)
{
MethodInfo displayName = type.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static);
if (displayName != null)
{
logger.Info("Mono: " + displayName.Invoke(null, null));
}
}
logger.Info("Application Path: {0}", appPaths.ApplicationPath);
logger.Info("*** When reporting issues please include the entire log file. ***".ToUpper());

View File

@ -46,6 +46,21 @@ namespace MediaBrowser.Controller.Entities
}
}
/// <summary>
/// TODO: Remove
/// </summary>
public string Artist
{
get { return Artists.FirstOrDefault(); }
set
{
if (!string.IsNullOrEmpty(value) && !Artists.Contains(value, StringComparer.OrdinalIgnoreCase))
{
Artists.Add(value);
}
}
}
/// <summary>
/// Determines whether the specified name has artist.
/// </summary>

View File

@ -541,7 +541,6 @@ namespace MediaBrowser.Dlna
public void Dispose()
{
throw new NotImplementedException();
}
}
}

View File

@ -34,7 +34,7 @@ namespace MediaBrowser.Server.Implementations.Connect
{
LoadCachedAddress();
_timer = new Timer(TimerCallback, null, TimeSpan.FromSeconds(30), TimeSpan.FromHours(12));
_timer = new Timer(TimerCallback, null, TimeSpan.FromSeconds(10), TimeSpan.FromHours(12));
}
private async void TimerCallback(object state)

View File

@ -1,4 +1,6 @@
using MediaBrowser.Common.Configuration;
using System.IO;
using System.Text;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
@ -79,21 +81,42 @@ namespace MediaBrowser.XbmcMetadata.Parsers
{
using (var streamReader = BaseNfoSaver.GetStreamReader(metadataFile))
{
// Use XmlReader for best performance
using (var reader = XmlReader.Create(streamReader, settings))
// Need to handle a url after the xml data
// http://kodi.wiki/view/NFO_files/movies
var xml = streamReader.ReadToEnd();
var index = xml.LastIndexOf('>');
if (index != -1)
{
reader.MoveToContent();
xml = xml.Substring(0, index + 1);
}
// Loop through each element
while (reader.Read())
using (var ms = new MemoryStream())
{
var bytes = Encoding.UTF8.GetBytes(xml);
ms.Write(bytes, 0, bytes.Length);
ms.Position = 0;
// Use XmlReader for best performance
using (var reader = XmlReader.Create(ms, settings))
{
cancellationToken.ThrowIfCancellationRequested();
reader.MoveToContent();
if (reader.NodeType == XmlNodeType.Element)
// Loop through each element
while (reader.Read())
{
FetchDataFromXmlNode(reader, item, userDataList);
cancellationToken.ThrowIfCancellationRequested();
if (reader.NodeType == XmlNodeType.Element)
{
FetchDataFromXmlNode(reader, item, userDataList);
}
}
}
}
}
}