mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-16 22:13:06 +03:00
Remove warnings from MediaBrowser.LocalMetadata
This commit is contained in:
@@ -7,12 +7,43 @@ using MediaBrowser.Model.IO;
|
||||
|
||||
namespace MediaBrowser.LocalMetadata
|
||||
{
|
||||
/// <summary>
|
||||
/// The BaseXmlProvider.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Type of provider.</typeparam>
|
||||
public abstract class BaseXmlProvider<T> : ILocalMetadataProvider<T>, IHasItemChangeMonitor, IHasOrder
|
||||
where T : BaseItem, new()
|
||||
{
|
||||
protected IFileSystem FileSystem;
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="BaseXmlProvider{T}"/> class.
|
||||
/// </summary>
|
||||
/// <param name="fileSystem">Instance of the <see cref="IFileSystem"/> interface.</param>
|
||||
protected BaseXmlProvider(IFileSystem fileSystem)
|
||||
{
|
||||
this.FileSystem = fileSystem;
|
||||
}
|
||||
|
||||
public Task<MetadataResult<T>> GetMetadata(ItemInfo info,
|
||||
/// <inheritdoc />
|
||||
public string Name => XmlProviderUtils.Name;
|
||||
|
||||
/// After Nfo
|
||||
/// <inheritdoc />
|
||||
public virtual int Order => 1;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the IFileSystem.
|
||||
/// </summary>
|
||||
protected IFileSystem FileSystem { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets metadata for item.
|
||||
/// </summary>
|
||||
/// <param name="info">The item info.</param>
|
||||
/// <param name="directoryService">Instance of the <see cref="IDirectoryService"/> interface.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>The metadata for item.</returns>
|
||||
public Task<MetadataResult<T>> GetMetadata(
|
||||
ItemInfo info,
|
||||
IDirectoryService directoryService,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
@@ -46,15 +77,23 @@ namespace MediaBrowser.LocalMetadata
|
||||
return Task.FromResult(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get metadata from path.
|
||||
/// </summary>
|
||||
/// <param name="result">Resulting metadata.</param>
|
||||
/// <param name="path">The path.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
protected abstract void Fetch(MetadataResult<T> result, string path, CancellationToken cancellationToken);
|
||||
|
||||
protected BaseXmlProvider(IFileSystem fileSystem)
|
||||
{
|
||||
FileSystem = fileSystem;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get metadata from xml file.
|
||||
/// </summary>
|
||||
/// <param name="info">Item inf.</param>
|
||||
/// <param name="directoryService">Instance of the <see cref="IDirectoryService"/> interface.</param>
|
||||
/// <returns>The file system metadata.</returns>
|
||||
protected abstract FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService);
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool HasChanged(BaseItem item, IDirectoryService directoryService)
|
||||
{
|
||||
var file = GetXmlFile(new ItemInfo(item), directoryService);
|
||||
@@ -66,15 +105,5 @@ namespace MediaBrowser.LocalMetadata
|
||||
|
||||
return file.Exists && FileSystem.GetLastWriteTimeUtc(file) > item.DateLastSaved;
|
||||
}
|
||||
|
||||
public string Name => XmlProviderUtils.Name;
|
||||
|
||||
//After Nfo
|
||||
public virtual int Order => 1;
|
||||
}
|
||||
|
||||
static class XmlProviderUtils
|
||||
{
|
||||
public static string Name => "Emby Xml";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user