avoid provider refreshes after xml saves

This commit is contained in:
Luke Pulverenti 2013-07-17 11:55:18 -04:00
parent 243fe97d11
commit 587c2ff729
8 changed files with 28 additions and 5 deletions

View File

@ -2,11 +2,11 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Model.Logging;
namespace MediaBrowser.Providers
{
@ -15,9 +15,12 @@ namespace MediaBrowser.Providers
/// </summary>
public class FolderProviderFromXml : BaseMetadataProvider
{
public static FolderProviderFromXml Current;
public FolderProviderFromXml(ILogManager logManager, IServerConfigurationManager configurationManager)
: base(logManager, configurationManager)
{
Current = this;
}
/// <summary>

View File

@ -16,9 +16,12 @@ namespace MediaBrowser.Providers.Movies
/// </summary>
public class BoxSetProviderFromXml : BaseMetadataProvider
{
public static BoxSetProviderFromXml Current;
public BoxSetProviderFromXml(ILogManager logManager, IServerConfigurationManager configurationManager)
: base(logManager, configurationManager)
{
Current = this;
}
/// <summary>

View File

@ -13,9 +13,12 @@ namespace MediaBrowser.Providers.Music
{
class ArtistProviderFromXml : BaseMetadataProvider
{
public static ArtistProviderFromXml Current;
public ArtistProviderFromXml(ILogManager logManager, IServerConfigurationManager configurationManager)
: base(logManager, configurationManager)
{
Current = this;
}
/// <summary>

View File

@ -8,6 +8,7 @@ using System;
using System.IO;
using System.Text;
using System.Threading;
using MediaBrowser.Providers.Music;
namespace MediaBrowser.Providers.Savers
{
@ -72,7 +73,7 @@ namespace MediaBrowser.Providers.Savers
XmlSaverHelpers.Save(builder, xmlFilePath, new string[] { });
// Set last refreshed so that the provider doesn't trigger after the file save
PersonProviderFromXml.Current.SetLastRefreshed(item, DateTime.UtcNow);
ArtistProviderFromXml.Current.SetLastRefreshed(item, DateTime.UtcNow);
}
/// <summary>

View File

@ -2,7 +2,8 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Entities;
using MediaBrowser.Providers.Movies;
using System;
using System.IO;
using System.Text;
using System.Threading;
@ -57,6 +58,8 @@ namespace MediaBrowser.Providers.Savers
var xmlFilePath = GetSavePath(item);
XmlSaverHelpers.Save(builder, xmlFilePath, new string[] { });
BoxSetProviderFromXml.Current.SetLastRefreshed(item, DateTime.UtcNow);
}
/// <summary>

View File

@ -1,4 +1,5 @@
using MediaBrowser.Controller.Configuration;
using System;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Entities.Movies;
@ -77,6 +78,8 @@ namespace MediaBrowser.Providers.Savers
var xmlFilePath = GetSavePath(item);
XmlSaverHelpers.Save(builder, xmlFilePath, new string[] { });
FolderProviderFromXml.Current.SetLastRefreshed(item, DateTime.UtcNow);
}
/// <summary>

View File

@ -1,10 +1,12 @@
using MediaBrowser.Controller.Configuration;
using System;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Library;
using System.IO;
using System.Text;
using System.Threading;
using MediaBrowser.Providers.TV;
namespace MediaBrowser.Providers.Savers
{
@ -56,6 +58,8 @@ namespace MediaBrowser.Providers.Savers
var xmlFilePath = GetSavePath(item);
XmlSaverHelpers.Save(builder, xmlFilePath, new string[] { });
SeasonProviderFromXml.Current.SetLastRefreshed(item, DateTime.UtcNow);
}
/// <summary>

View File

@ -16,9 +16,12 @@ namespace MediaBrowser.Providers.TV
/// </summary>
public class SeasonProviderFromXml : BaseMetadataProvider
{
public static SeasonProviderFromXml Current;
public SeasonProviderFromXml(ILogManager logManager, IServerConfigurationManager configurationManager)
: base(logManager, configurationManager)
{
Current = this;
}
/// <summary>