2014-10-20 20:23:40 +00:00
|
|
|
|
using MediaBrowser.Controller.Entities;
|
2013-07-10 20:25:47 +00:00
|
|
|
|
using MediaBrowser.Controller.Providers;
|
|
|
|
|
using MediaBrowser.Model.Logging;
|
2014-10-20 20:23:40 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Xml;
|
2016-10-30 07:02:23 +00:00
|
|
|
|
using MediaBrowser.Model.IO;
|
|
|
|
|
using MediaBrowser.Model.Xml;
|
2013-07-10 20:25:47 +00:00
|
|
|
|
|
2014-06-30 03:04:50 +00:00
|
|
|
|
namespace MediaBrowser.LocalMetadata.Parsers
|
2013-07-10 20:25:47 +00:00
|
|
|
|
{
|
2015-06-29 01:10:45 +00:00
|
|
|
|
public class MusicVideoXmlParser : BaseVideoXmlParser<MusicVideo>
|
2013-07-10 20:25:47 +00:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Fetches the data from XML node.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="reader">The reader.</param>
|
2015-06-29 01:10:45 +00:00
|
|
|
|
/// <param name="result">The result.</param>
|
|
|
|
|
protected override void FetchDataFromXmlNode(XmlReader reader, MetadataResult<MusicVideo> result)
|
2013-07-10 20:25:47 +00:00
|
|
|
|
{
|
2015-06-29 01:10:45 +00:00
|
|
|
|
var item = result.Item;
|
|
|
|
|
|
2013-07-10 20:25:47 +00:00
|
|
|
|
switch (reader.Name)
|
|
|
|
|
{
|
|
|
|
|
case "Artist":
|
2014-10-20 20:23:40 +00:00
|
|
|
|
{
|
|
|
|
|
var val = reader.ReadElementContentAsString();
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(val))
|
|
|
|
|
{
|
|
|
|
|
var artists = val.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
|
|
|
|
|
item.Artists.AddRange(artists);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
2013-07-10 20:25:47 +00:00
|
|
|
|
|
|
|
|
|
case "Album":
|
|
|
|
|
item.Album = reader.ReadElementContentAsString();
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
2015-06-29 01:10:45 +00:00
|
|
|
|
base.FetchDataFromXmlNode(reader, result);
|
2013-07-10 20:25:47 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-10-30 07:02:23 +00:00
|
|
|
|
|
|
|
|
|
public MusicVideoXmlParser(ILogger logger, IProviderManager providerManager, IXmlReaderSettingsFactory xmlReaderSettingsFactory, IFileSystem fileSystem) : base(logger, providerManager, xmlReaderSettingsFactory, fileSystem)
|
|
|
|
|
{
|
|
|
|
|
}
|
2013-07-10 20:25:47 +00:00
|
|
|
|
}
|
|
|
|
|
}
|