2019-01-13 15:02:23 -05:00
|
|
|
using System.IO;
|
2019-01-13 14:25:45 -05:00
|
|
|
using System.Xml;
|
|
|
|
using MediaBrowser.Controller.Configuration;
|
2014-06-29 23:04:50 -04:00
|
|
|
using MediaBrowser.Controller.Entities;
|
|
|
|
using MediaBrowser.Controller.Entities.Movies;
|
|
|
|
using MediaBrowser.Controller.Library;
|
2016-10-25 15:02:04 -04:00
|
|
|
using MediaBrowser.Model.IO;
|
2019-01-13 14:25:45 -05:00
|
|
|
using Microsoft.Extensions.Logging;
|
2013-06-27 10:51:40 -04:00
|
|
|
|
2014-06-29 23:04:50 -04:00
|
|
|
namespace MediaBrowser.LocalMetadata.Savers
|
2013-06-27 10:51:40 -04:00
|
|
|
{
|
2020-06-13 22:04:53 -04:00
|
|
|
/// <summary>
|
|
|
|
/// Box set xml saver.
|
|
|
|
/// </summary>
|
2016-10-30 03:02:23 -04:00
|
|
|
public class BoxSetXmlSaver : BaseXmlSaver
|
2013-06-27 10:51:40 -04:00
|
|
|
{
|
2020-06-13 22:04:53 -04:00
|
|
|
/// <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="logger">Instance of the <see cref="ILogger{BoxSetXmlSaver}"/> interface.</param>
|
2021-08-04 08:40:09 -04:00
|
|
|
public BoxSetXmlSaver(IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, ILogger<BoxSetXmlSaver> logger)
|
|
|
|
: base(fileSystem, configurationManager, libraryManager, logger)
|
2020-06-13 22:04:53 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
2018-09-12 13:26:21 -04:00
|
|
|
public override bool IsEnabledFor(BaseItem item, ItemUpdateType updateType)
|
2013-06-27 10:51:40 -04:00
|
|
|
{
|
2014-02-10 15:11:46 -05:00
|
|
|
if (!item.SupportsLocalMetadata)
|
2014-02-08 15:02:35 -05:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2014-02-11 16:41:01 -05:00
|
|
|
return item is BoxSet && updateType >= ItemUpdateType.MetadataDownload;
|
2013-06-27 10:51:40 -04:00
|
|
|
}
|
|
|
|
|
2020-06-13 22:04:53 -04:00
|
|
|
/// <inheritdoc />
|
2018-09-12 13:26:21 -04:00
|
|
|
protected override void WriteCustomElements(BaseItem item, XmlWriter writer)
|
2013-06-27 10:51:40 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-06-13 22:04:53 -04:00
|
|
|
/// <inheritdoc />
|
2018-09-12 13:26:21 -04:00
|
|
|
protected override string GetLocalSavePath(BaseItem item)
|
2013-06-27 10:51:40 -04:00
|
|
|
{
|
|
|
|
return Path.Combine(item.Path, "collection.xml");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|