jellyfin/MediaBrowser.Providers/Movies/MovieXmlParser.cs

60 lines
1.7 KiB
C#
Raw Normal View History

2013-08-12 12:18:31 -07:00
using MediaBrowser.Controller.Entities;
2013-10-17 08:34:47 -07:00
using MediaBrowser.Controller.Entities.Movies;
2013-08-12 12:18:31 -07:00
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Logging;
using System.Threading;
using System.Xml;
namespace MediaBrowser.Providers.Movies
{
/// <summary>
/// Class EpisodeXmlParser
/// </summary>
public class MovieXmlParser : BaseItemXmlParser<Video>
{
public MovieXmlParser(ILogger logger)
2013-08-12 12:18:31 -07:00
: base(logger)
{
}
public void FetchAsync(Video item, string metadataFile, CancellationToken cancellationToken)
2013-08-12 12:18:31 -07:00
{
Fetch(item, metadataFile, cancellationToken);
}
/// <summary>
/// Fetches the data from XML node.
/// </summary>
/// <param name="reader">The reader.</param>
/// <param name="item">The item.</param>
protected override void FetchDataFromXmlNode(XmlReader reader, Video item)
{
switch (reader.Name)
{
2013-10-17 08:34:47 -07:00
case "TmdbCollectionName":
{
var val = reader.ReadElementContentAsString();
var movie = item as Movie;
if (!string.IsNullOrWhiteSpace(val) && movie != null)
{
movie.TmdbCollectionName = val;
}
break;
}
2013-08-12 12:18:31 -07:00
case "Chapters":
2013-08-30 16:55:17 -07:00
//_chaptersTask = FetchChaptersFromXmlNode(item, reader.ReadSubtree(), _itemRepo, CancellationToken.None);
2013-08-12 12:18:31 -07:00
break;
default:
base.FetchDataFromXmlNode(reader, item);
break;
}
}
}
}