2015-06-29 01:10:45 +00:00
|
|
|
|
using MediaBrowser.Controller.Entities;
|
2013-10-17 15:34:47 +00:00
|
|
|
|
using MediaBrowser.Controller.Entities.Movies;
|
2013-08-12 19:18:31 +00:00
|
|
|
|
using MediaBrowser.Controller.Providers;
|
|
|
|
|
using MediaBrowser.Model.Logging;
|
2015-06-29 01:10:45 +00:00
|
|
|
|
using System.Xml;
|
2016-10-30 07:02:23 +00:00
|
|
|
|
using MediaBrowser.Model.IO;
|
|
|
|
|
using MediaBrowser.Model.Xml;
|
2013-08-12 19:18:31 +00:00
|
|
|
|
|
2014-06-30 03:04:50 +00:00
|
|
|
|
namespace MediaBrowser.LocalMetadata.Parsers
|
2013-08-12 19:18:31 +00:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Class EpisodeXmlParser
|
|
|
|
|
/// </summary>
|
2015-06-29 01:10:45 +00:00
|
|
|
|
public class BaseVideoXmlParser<T> : BaseItemXmlParser<T>
|
|
|
|
|
where T : Video
|
2013-08-12 19:18:31 +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<T> result)
|
2013-08-12 19:18:31 +00:00
|
|
|
|
{
|
2015-06-29 01:10:45 +00:00
|
|
|
|
var item = result.Item;
|
|
|
|
|
|
2013-08-12 19:18:31 +00:00
|
|
|
|
switch (reader.Name)
|
|
|
|
|
{
|
2013-10-17 15:34:47 +00:00
|
|
|
|
case "TmdbCollectionName":
|
|
|
|
|
{
|
|
|
|
|
var val = reader.ReadElementContentAsString();
|
|
|
|
|
var movie = item as Movie;
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(val) && movie != null)
|
|
|
|
|
{
|
2016-03-14 01:34:24 +00:00
|
|
|
|
movie.CollectionName = val;
|
2013-10-17 15:34:47 +00:00
|
|
|
|
}
|
2014-05-14 20:55:16 +00:00
|
|
|
|
|
2013-10-17 15:34:47 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2013-08-12 19:18:31 +00:00
|
|
|
|
default:
|
2015-06-29 01:10:45 +00:00
|
|
|
|
base.FetchDataFromXmlNode(reader, result);
|
2013-08-12 19:18:31 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-10-30 07:02:23 +00:00
|
|
|
|
|
|
|
|
|
public BaseVideoXmlParser(ILogger logger, IProviderManager providerManager, IXmlReaderSettingsFactory xmlReaderSettingsFactory, IFileSystem fileSystem) : base(logger, providerManager, xmlReaderSettingsFactory, fileSystem)
|
|
|
|
|
{
|
|
|
|
|
}
|
2013-08-12 19:18:31 +00:00
|
|
|
|
}
|
2015-06-29 01:10:45 +00:00
|
|
|
|
|
|
|
|
|
public class MovieXmlParser : BaseVideoXmlParser<Movie>
|
|
|
|
|
{
|
2016-10-30 07:02:23 +00:00
|
|
|
|
public MovieXmlParser(ILogger logger, IProviderManager providerManager, IXmlReaderSettingsFactory xmlReaderSettingsFactory, IFileSystem fileSystem) : base(logger, providerManager, xmlReaderSettingsFactory, fileSystem)
|
2015-06-29 01:10:45 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class VideoXmlParser : BaseVideoXmlParser<Video>
|
|
|
|
|
{
|
2016-10-30 07:02:23 +00:00
|
|
|
|
public VideoXmlParser(ILogger logger, IProviderManager providerManager, IXmlReaderSettingsFactory xmlReaderSettingsFactory, IFileSystem fileSystem) : base(logger, providerManager, xmlReaderSettingsFactory, fileSystem)
|
2015-06-29 01:10:45 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|
2013-08-12 19:18:31 +00:00
|
|
|
|
}
|