2019-01-13 21:03:10 +01:00
|
|
|
using System.IO;
|
2019-01-13 20:26:56 +01:00
|
|
|
using System.Threading;
|
|
|
|
using MediaBrowser.Common.Configuration;
|
2014-01-31 05:50:09 +01:00
|
|
|
using MediaBrowser.Controller.Entities.Audio;
|
|
|
|
using MediaBrowser.Controller.Providers;
|
2016-10-25 21:02:04 +02:00
|
|
|
using MediaBrowser.Model.IO;
|
2019-01-13 20:26:56 +01:00
|
|
|
using MediaBrowser.XbmcMetadata.Parsers;
|
|
|
|
using Microsoft.Extensions.Logging;
|
2014-01-31 05:50:09 +01:00
|
|
|
|
2014-06-30 05:04:50 +02:00
|
|
|
namespace MediaBrowser.XbmcMetadata.Providers
|
2014-01-31 05:50:09 +01:00
|
|
|
{
|
2014-06-30 05:04:50 +02:00
|
|
|
public class ArtistNfoProvider : BaseNfoProvider<MusicArtist>
|
2014-01-31 05:50:09 +01:00
|
|
|
{
|
|
|
|
private readonly ILogger _logger;
|
2014-06-30 05:04:50 +02:00
|
|
|
private readonly IConfigurationManager _config;
|
2016-08-27 06:33:18 +02:00
|
|
|
private readonly IProviderManager _providerManager;
|
2014-01-31 05:50:09 +01:00
|
|
|
|
2020-03-03 23:07:10 +01:00
|
|
|
public ArtistNfoProvider(
|
|
|
|
IFileSystem fileSystem,
|
|
|
|
ILogger<ArtistNfoProvider> logger,
|
|
|
|
IConfigurationManager config,
|
|
|
|
IProviderManager providerManager)
|
2014-01-31 05:50:09 +01:00
|
|
|
: base(fileSystem)
|
|
|
|
{
|
|
|
|
_logger = logger;
|
2014-06-30 05:04:50 +02:00
|
|
|
_config = config;
|
2016-08-27 06:33:18 +02:00
|
|
|
_providerManager = providerManager;
|
2014-01-31 05:50:09 +01:00
|
|
|
}
|
|
|
|
|
2019-08-18 19:54:07 +02:00
|
|
|
/// <inheritdoc />
|
2015-08-02 19:31:08 +02:00
|
|
|
protected override void Fetch(MetadataResult<MusicArtist> result, string path, CancellationToken cancellationToken)
|
2014-01-31 05:50:09 +01:00
|
|
|
{
|
2019-02-01 17:43:31 +01:00
|
|
|
new BaseNfoParser<MusicArtist>(_logger, _config, _providerManager).Fetch(result, path, cancellationToken);
|
2014-01-31 05:50:09 +01:00
|
|
|
}
|
|
|
|
|
2019-08-18 19:54:07 +02:00
|
|
|
/// <inheritdoc />
|
2015-10-04 05:38:46 +02:00
|
|
|
protected override FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService)
|
2019-08-18 19:54:07 +02:00
|
|
|
=> directoryService.GetFile(Path.Combine(info.Path, "artist.nfo"));
|
2014-01-31 05:50:09 +01:00
|
|
|
}
|
|
|
|
}
|