using MediaBrowser.Common.IO;
using MediaBrowser.Common.MediaInfo;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
using System;
using System.Threading.Tasks;
namespace MediaBrowser.Providers.MediaInfo
{
///
/// Class BaseFFMpegProvider
///
///
public abstract class BaseFFMpegProvider : BaseMetadataProvider
where T : BaseItem
{
protected readonly IMediaEncoder MediaEncoder;
protected BaseFFMpegProvider(ILogManager logManager, IServerConfigurationManager configurationManager, IMediaEncoder mediaEncoder) : base(logManager, configurationManager)
{
MediaEncoder = mediaEncoder;
}
///
/// Supportses the specified item.
///
/// The item.
/// true if XXXX, false otherwise
public override bool Supports(BaseItem item)
{
return item.LocationType == LocationType.FileSystem && item is T;
}
///
/// Override this to return the date that should be compared to the last refresh date
/// to determine if this provider should be re-fetched.
///
/// The item.
/// DateTime.
protected override DateTime CompareDate(BaseItem item)
{
return item.DateModified;
}
///
/// The null mount task result
///
protected readonly Task NullMountTaskResult = Task.FromResult(null);
///
/// Gets the provider version.
///
/// The provider version.
protected override string ProviderVersion
{
get
{
return MediaEncoder.Version;
}
}
///
/// Gets a value indicating whether [refresh on version change].
///
/// true if [refresh on version change]; otherwise, false.
protected override bool RefreshOnVersionChange
{
get
{
return true;
}
}
}
}