2014-09-06 06:21:23 +02:00
|
|
|
|
using MediaBrowser.Controller.Configuration;
|
|
|
|
|
using MediaBrowser.Controller.Entities;
|
2013-06-23 20:55:30 +02:00
|
|
|
|
using MediaBrowser.Controller.Entities.Audio;
|
2013-06-23 19:48:30 +02:00
|
|
|
|
using MediaBrowser.Controller.Entities.Movies;
|
|
|
|
|
using MediaBrowser.Controller.Entities.TV;
|
|
|
|
|
using MediaBrowser.Controller.Library;
|
2014-08-03 04:16:37 +02:00
|
|
|
|
using MediaBrowser.Controller.Playlists;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading;
|
2016-10-28 20:45:56 +02:00
|
|
|
|
using System.Xml;
|
2016-10-25 21:02:04 +02:00
|
|
|
|
using MediaBrowser.Model.IO;
|
2016-10-28 20:45:56 +02:00
|
|
|
|
using MediaBrowser.Model.Logging;
|
|
|
|
|
using MediaBrowser.Model.Xml;
|
2013-06-23 19:48:30 +02:00
|
|
|
|
|
2014-06-30 05:04:50 +02:00
|
|
|
|
namespace MediaBrowser.LocalMetadata.Savers
|
2013-06-23 19:48:30 +02:00
|
|
|
|
{
|
2016-10-28 20:45:56 +02:00
|
|
|
|
public class FolderXmlSaver : BaseXmlSaver
|
2013-06-23 19:48:30 +02:00
|
|
|
|
{
|
2016-10-28 20:45:56 +02:00
|
|
|
|
protected override string GetLocalSavePath(IHasMetadata item)
|
2014-02-02 14:36:31 +01:00
|
|
|
|
{
|
2016-10-28 20:45:56 +02:00
|
|
|
|
return Path.Combine(item.Path, "folder.xml");
|
2014-02-02 14:36:31 +01:00
|
|
|
|
}
|
|
|
|
|
|
2016-10-28 20:45:56 +02:00
|
|
|
|
protected override string GetRootElementName(IHasMetadata item)
|
2014-09-06 06:21:23 +02:00
|
|
|
|
{
|
2016-10-28 20:45:56 +02:00
|
|
|
|
return "Item";
|
2014-09-06 06:21:23 +02:00
|
|
|
|
}
|
|
|
|
|
|
2016-10-28 20:45:56 +02:00
|
|
|
|
public override bool IsEnabledFor(IHasMetadata item, ItemUpdateType updateType)
|
2013-06-23 19:48:30 +02:00
|
|
|
|
{
|
2014-02-10 21:11:46 +01:00
|
|
|
|
if (!item.SupportsLocalMetadata)
|
2014-02-08 21:02:35 +01:00
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2014-02-11 22:41:01 +01:00
|
|
|
|
if (item is Folder)
|
2013-06-25 20:10:39 +02:00
|
|
|
|
{
|
2013-06-28 01:01:03 +02:00
|
|
|
|
if (!(item is Series) && !(item is BoxSet) && !(item is MusicArtist) && !(item is MusicAlbum) &&
|
2014-02-02 14:36:31 +01:00
|
|
|
|
!(item is Season) &&
|
2014-08-03 04:16:37 +02:00
|
|
|
|
!(item is GameSystem) &&
|
|
|
|
|
!(item is Playlist))
|
2013-06-28 01:01:03 +02:00
|
|
|
|
{
|
2014-12-28 07:21:39 +01:00
|
|
|
|
return updateType >= ItemUpdateType.MetadataEdit;
|
2013-06-28 01:01:03 +02:00
|
|
|
|
}
|
2013-06-25 20:10:39 +02:00
|
|
|
|
}
|
|
|
|
|
|
2013-06-28 01:01:03 +02:00
|
|
|
|
return false;
|
2013-06-23 19:48:30 +02:00
|
|
|
|
}
|
|
|
|
|
|
2016-10-28 20:45:56 +02:00
|
|
|
|
protected override void WriteCustomElements(IHasMetadata item, XmlWriter writer)
|
2013-06-23 19:48:30 +02:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-28 20:45:56 +02:00
|
|
|
|
public FolderXmlSaver(IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILogger logger, IXmlReaderSettingsFactory xmlReaderSettingsFactory) : base(fileSystem, configurationManager, libraryManager, userManager, userDataManager, logger, xmlReaderSettingsFactory)
|
2013-06-23 19:48:30 +02:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|