mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-15 02:33:33 +01:00
New provider system. Only for people right now
This commit is contained in:
28
MediaBrowser.Providers/BaseXmlProvider.cs
Normal file
28
MediaBrowser.Providers/BaseXmlProvider.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using System;
|
||||
using System.Threading;
|
||||
|
||||
namespace MediaBrowser.Providers
|
||||
{
|
||||
public abstract class BaseXmlProvider: IHasChangeMonitor
|
||||
{
|
||||
protected static readonly SemaphoreSlim XmlParsingResourcePool = new SemaphoreSlim(4, 4);
|
||||
|
||||
protected IFileSystem FileSystem;
|
||||
|
||||
protected BaseXmlProvider(IFileSystem fileSystem)
|
||||
{
|
||||
FileSystem = fileSystem;
|
||||
}
|
||||
|
||||
protected abstract string GetXmlPath(string path);
|
||||
|
||||
public bool HasChanged(IHasMetadata item, DateTime date)
|
||||
{
|
||||
var path = GetXmlPath(item.Path);
|
||||
|
||||
return FileSystem.GetLastWriteTimeUtc(path) > date;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user