using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Logging;
using System.Xml;
namespace MediaBrowser.LocalMetadata.Parsers
{
///
/// Class EpisodeXmlParser
///
public class BaseVideoXmlParser : BaseItemXmlParser
where T : Video
{
public BaseVideoXmlParser(ILogger logger)
: base(logger)
{
}
///
/// Fetches the data from XML node.
///
/// The reader.
/// The result.
protected override void FetchDataFromXmlNode(XmlReader reader, MetadataResult result)
{
var item = result.Item;
switch (reader.Name)
{
case "TmdbCollectionName":
{
var val = reader.ReadElementContentAsString();
var movie = item as Movie;
if (!string.IsNullOrWhiteSpace(val) && movie != null)
{
movie.CollectionName = val;
}
break;
}
default:
base.FetchDataFromXmlNode(reader, result);
break;
}
}
}
public class MovieXmlParser : BaseVideoXmlParser
{
public MovieXmlParser(ILogger logger) : base(logger)
{
}
}
public class VideoXmlParser : BaseVideoXmlParser