using System.IO;
using System.Threading.Tasks;
using System.Xml;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.IO;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.LocalMetadata.Savers
{
///
/// Box set xml saver.
///
public class BoxSetXmlSaver : BaseXmlSaver
{
///
/// Initializes a new instance of the class.
///
/// Instance of the interface.
/// Instance of the interface.
/// Instance of the interface.
/// Instance of the interface.
public BoxSetXmlSaver(IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, ILogger logger)
: base(fileSystem, configurationManager, libraryManager, logger)
{
}
///
public override bool IsEnabledFor(BaseItem item, ItemUpdateType updateType)
{
if (!item.SupportsLocalMetadata)
{
return false;
}
return item is BoxSet && updateType >= ItemUpdateType.MetadataDownload;
}
///
protected override Task WriteCustomElementsAsync(BaseItem item, XmlWriter writer)
=> Task.CompletedTask;
///
protected override string GetLocalSavePath(BaseItem item)
{
return Path.Combine(item.Path, "collection.xml");
}
}
}