You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
2.1 KiB
54 lines
2.1 KiB
using System.IO;
|
|
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
|
|
{
|
|
/// <summary>
|
|
/// Box set xml saver.
|
|
/// </summary>
|
|
public class BoxSetXmlSaver : BaseXmlSaver
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="BoxSetXmlSaver"/> class.
|
|
/// </summary>
|
|
/// <param name="fileSystem">Instance of the <see cref="IFileSystem"/> interface.</param>
|
|
/// <param name="configurationManager">Instance of the <see cref="IServerConfigurationManager"/> interface.</param>
|
|
/// <param name="libraryManager">Instance of the <see cref="ILibraryManager"/> interface.</param>
|
|
/// <param name="userManager">Instance of the <see cref="IUserManager"/> interface.</param>
|
|
/// <param name="userDataManager">Instance of the <see cref="IUserDataManager"/> interface.</param>
|
|
/// <param name="logger">Instance of the <see cref="ILogger{BoxSetXmlSaver}"/> interface.</param>
|
|
public BoxSetXmlSaver(IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILogger<BoxSetXmlSaver> logger)
|
|
: base(fileSystem, configurationManager, libraryManager, userManager, userDataManager, logger)
|
|
{
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public override bool IsEnabledFor(BaseItem item, ItemUpdateType updateType)
|
|
{
|
|
if (!item.SupportsLocalMetadata)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
return item is BoxSet && updateType >= ItemUpdateType.MetadataDownload;
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void WriteCustomElements(BaseItem item, XmlWriter writer)
|
|
{
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override string GetLocalSavePath(BaseItem item)
|
|
{
|
|
return Path.Combine(item.Path, "collection.xml");
|
|
}
|
|
}
|
|
}
|