mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-25 22:36:59 -04:00
New: Readarr 0.1
This commit is contained in:
@@ -1,192 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Disk;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Core.Extras.Metadata.Files;
|
||||
using NzbDrone.Core.MediaCover;
|
||||
using NzbDrone.Core.MediaFiles;
|
||||
using NzbDrone.Core.Music;
|
||||
|
||||
namespace NzbDrone.Core.Extras.Metadata.Consumers.Roksbox
|
||||
{
|
||||
public class RoksboxMetadata : MetadataBase<RoksboxMetadataSettings>
|
||||
{
|
||||
private readonly IMapCoversToLocal _mediaCoverService;
|
||||
private readonly IDiskProvider _diskProvider;
|
||||
private readonly Logger _logger;
|
||||
|
||||
public RoksboxMetadata(IMapCoversToLocal mediaCoverService,
|
||||
IDiskProvider diskProvider,
|
||||
Logger logger)
|
||||
{
|
||||
_mediaCoverService = mediaCoverService;
|
||||
_diskProvider = diskProvider;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
private static readonly Regex SeasonImagesRegex = new Regex(@"^(season (?<season>\d+))|(?<specials>specials)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
public override string Name => "Roksbox";
|
||||
|
||||
public override string GetFilenameAfterMove(Artist artist, TrackFile trackFile, MetadataFile metadataFile)
|
||||
{
|
||||
var trackFilePath = trackFile.Path;
|
||||
|
||||
if (metadataFile.Type == MetadataType.TrackMetadata)
|
||||
{
|
||||
return GetTrackMetadataFilename(trackFilePath);
|
||||
}
|
||||
|
||||
_logger.Debug("Unknown track file metadata: {0}", metadataFile.RelativePath);
|
||||
return Path.Combine(artist.Path, metadataFile.RelativePath);
|
||||
}
|
||||
|
||||
public override MetadataFile FindMetadataFile(Artist artist, string path)
|
||||
{
|
||||
var filename = Path.GetFileName(path);
|
||||
|
||||
if (filename == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var parentdir = Directory.GetParent(path);
|
||||
|
||||
var metadata = new MetadataFile
|
||||
{
|
||||
ArtistId = artist.Id,
|
||||
Consumer = GetType().Name,
|
||||
RelativePath = artist.Path.GetRelativePath(path)
|
||||
};
|
||||
|
||||
//Series and season images are both named folder.jpg, only season ones sit in season folders
|
||||
if (Path.GetFileNameWithoutExtension(filename).Equals(parentdir.Name, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
var seasonMatch = SeasonImagesRegex.Match(parentdir.Name);
|
||||
|
||||
if (seasonMatch.Success)
|
||||
{
|
||||
metadata.Type = MetadataType.AlbumImage;
|
||||
|
||||
if (seasonMatch.Groups["specials"].Success)
|
||||
{
|
||||
metadata.AlbumId = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
metadata.AlbumId = Convert.ToInt32(seasonMatch.Groups["season"].Value);
|
||||
}
|
||||
|
||||
return metadata;
|
||||
}
|
||||
|
||||
metadata.Type = MetadataType.ArtistImage;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
var parseResult = Parser.Parser.ParseMusicTitle(filename);
|
||||
|
||||
if (parseResult != null)
|
||||
{
|
||||
var extension = Path.GetExtension(filename).ToLowerInvariant();
|
||||
|
||||
if (extension == ".xml")
|
||||
{
|
||||
metadata.Type = MetadataType.TrackMetadata;
|
||||
return metadata;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public override MetadataFileResult ArtistMetadata(Artist artist)
|
||||
{
|
||||
//Artist metadata is not supported
|
||||
return null;
|
||||
}
|
||||
|
||||
public override MetadataFileResult AlbumMetadata(Artist artist, Album album, string albumPath)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public override MetadataFileResult TrackMetadata(Artist artist, TrackFile trackFile)
|
||||
{
|
||||
if (!Settings.TrackMetadata)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
_logger.Debug("Generating Track Metadata for: {0}", trackFile.Path);
|
||||
|
||||
var xmlResult = string.Empty;
|
||||
foreach (var track in trackFile.Tracks.Value)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
var xws = new XmlWriterSettings();
|
||||
xws.OmitXmlDeclaration = true;
|
||||
xws.Indent = false;
|
||||
|
||||
using (var xw = XmlWriter.Create(sb, xws))
|
||||
{
|
||||
var doc = new XDocument();
|
||||
|
||||
var details = new XElement("song");
|
||||
details.Add(new XElement("title", track.Title));
|
||||
details.Add(new XElement("performingartist", artist.Name));
|
||||
|
||||
doc.Add(details);
|
||||
doc.Save(xw);
|
||||
|
||||
xmlResult += doc.ToString();
|
||||
xmlResult += Environment.NewLine;
|
||||
}
|
||||
}
|
||||
|
||||
return new MetadataFileResult(GetTrackMetadataFilename(artist.Path.GetRelativePath(trackFile.Path)), xmlResult.Trim(Environment.NewLine.ToCharArray()));
|
||||
}
|
||||
|
||||
public override List<ImageFileResult> ArtistImages(Artist artist)
|
||||
{
|
||||
if (!Settings.ArtistImages)
|
||||
{
|
||||
return new List<ImageFileResult>();
|
||||
}
|
||||
|
||||
var image = artist.Metadata.Value.Images.SingleOrDefault(c => c.CoverType == MediaCoverTypes.Poster) ?? artist.Metadata.Value.Images.FirstOrDefault();
|
||||
if (image == null)
|
||||
{
|
||||
_logger.Trace("Failed to find suitable Artist image for artist {0}.", artist.Name);
|
||||
return new List<ImageFileResult>();
|
||||
}
|
||||
|
||||
var source = _mediaCoverService.GetCoverPath(artist.Id, MediaCoverEntity.Artist, image.CoverType, image.Extension);
|
||||
var destination = Path.GetFileName(artist.Path) + Path.GetExtension(source);
|
||||
|
||||
return new List<ImageFileResult> { new ImageFileResult(destination, source) };
|
||||
}
|
||||
|
||||
public override List<ImageFileResult> AlbumImages(Artist artist, Album album, string albumFolder)
|
||||
{
|
||||
return new List<ImageFileResult>();
|
||||
}
|
||||
|
||||
public override List<ImageFileResult> TrackImages(Artist artist, TrackFile trackFile)
|
||||
{
|
||||
return new List<ImageFileResult>();
|
||||
}
|
||||
|
||||
private string GetTrackMetadataFilename(string trackFilePath)
|
||||
{
|
||||
return Path.ChangeExtension(trackFilePath, "xml");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
using FluentValidation;
|
||||
using NzbDrone.Core.Annotations;
|
||||
using NzbDrone.Core.ThingiProvider;
|
||||
using NzbDrone.Core.Validation;
|
||||
|
||||
namespace NzbDrone.Core.Extras.Metadata.Consumers.Roksbox
|
||||
{
|
||||
public class RoksboxSettingsValidator : AbstractValidator<RoksboxMetadataSettings>
|
||||
{
|
||||
}
|
||||
|
||||
public class RoksboxMetadataSettings : IProviderConfig
|
||||
{
|
||||
private static readonly RoksboxSettingsValidator Validator = new RoksboxSettingsValidator();
|
||||
|
||||
public RoksboxMetadataSettings()
|
||||
{
|
||||
TrackMetadata = true;
|
||||
ArtistImages = true;
|
||||
AlbumImages = true;
|
||||
}
|
||||
|
||||
[FieldDefinition(0, Label = "Track Metadata", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "Album\\filename.xml")]
|
||||
public bool TrackMetadata { get; set; }
|
||||
|
||||
[FieldDefinition(1, Label = "Artist Images", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "Artist Title.jpg")]
|
||||
public bool ArtistImages { get; set; }
|
||||
|
||||
[FieldDefinition(2, Label = "Album Images", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "Album Title.jpg")]
|
||||
public bool AlbumImages { get; set; }
|
||||
|
||||
public bool IsValid => true;
|
||||
|
||||
public NzbDroneValidationResult Validate()
|
||||
{
|
||||
return new NzbDroneValidationResult(Validator.Validate(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,151 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Disk;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Core.Extras.Metadata.Files;
|
||||
using NzbDrone.Core.MediaCover;
|
||||
using NzbDrone.Core.MediaFiles;
|
||||
using NzbDrone.Core.Music;
|
||||
|
||||
namespace NzbDrone.Core.Extras.Metadata.Consumers.Wdtv
|
||||
{
|
||||
public class WdtvMetadata : MetadataBase<WdtvMetadataSettings>
|
||||
{
|
||||
private readonly IMapCoversToLocal _mediaCoverService;
|
||||
private readonly IDiskProvider _diskProvider;
|
||||
private readonly Logger _logger;
|
||||
|
||||
public WdtvMetadata(IMapCoversToLocal mediaCoverService,
|
||||
IDiskProvider diskProvider,
|
||||
Logger logger)
|
||||
{
|
||||
_mediaCoverService = mediaCoverService;
|
||||
_diskProvider = diskProvider;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public override string Name => "WDTV";
|
||||
|
||||
public override string GetFilenameAfterMove(Artist artist, TrackFile trackFile, MetadataFile metadataFile)
|
||||
{
|
||||
var trackFilePath = trackFile.Path;
|
||||
|
||||
if (metadataFile.Type == MetadataType.TrackMetadata)
|
||||
{
|
||||
return GetTrackMetadataFilename(trackFilePath);
|
||||
}
|
||||
|
||||
_logger.Debug("Unknown track file metadata: {0}", metadataFile.RelativePath);
|
||||
return Path.Combine(artist.Path, metadataFile.RelativePath);
|
||||
}
|
||||
|
||||
public override MetadataFile FindMetadataFile(Artist artist, string path)
|
||||
{
|
||||
var filename = Path.GetFileName(path);
|
||||
|
||||
if (filename == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var metadata = new MetadataFile
|
||||
{
|
||||
ArtistId = artist.Id,
|
||||
Consumer = GetType().Name,
|
||||
RelativePath = artist.Path.GetRelativePath(path)
|
||||
};
|
||||
|
||||
var parseResult = Parser.Parser.ParseMusicTitle(filename);
|
||||
|
||||
if (parseResult != null)
|
||||
{
|
||||
switch (Path.GetExtension(filename).ToLowerInvariant())
|
||||
{
|
||||
case ".xml":
|
||||
metadata.Type = MetadataType.TrackMetadata;
|
||||
return metadata;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public override MetadataFileResult ArtistMetadata(Artist artist)
|
||||
{
|
||||
//Artist metadata is not supported
|
||||
return null;
|
||||
}
|
||||
|
||||
public override MetadataFileResult AlbumMetadata(Artist artist, Album album, string albumPath)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public override MetadataFileResult TrackMetadata(Artist artist, TrackFile trackFile)
|
||||
{
|
||||
if (!Settings.TrackMetadata)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
_logger.Debug("Generating Track Metadata for: {0}", trackFile.Path);
|
||||
|
||||
var xmlResult = string.Empty;
|
||||
foreach (var track in trackFile.Tracks.Value)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
var xws = new XmlWriterSettings();
|
||||
xws.OmitXmlDeclaration = true;
|
||||
xws.Indent = false;
|
||||
|
||||
using (var xw = XmlWriter.Create(sb, xws))
|
||||
{
|
||||
var doc = new XDocument();
|
||||
|
||||
var details = new XElement("details");
|
||||
details.Add(new XElement("id", artist.Id));
|
||||
details.Add(new XElement("title", string.Format("{0} - {1} - {2}", artist.Name, track.TrackNumber, track.Title)));
|
||||
details.Add(new XElement("artist_name", artist.Metadata.Value.Name));
|
||||
details.Add(new XElement("track_name", track.Title));
|
||||
details.Add(new XElement("track_number", track.AbsoluteTrackNumber.ToString("00")));
|
||||
details.Add(new XElement("member", string.Join(" / ", artist.Metadata.Value.Members.ConvertAll(c => c.Name + " - " + c.Instrument))));
|
||||
|
||||
doc.Add(details);
|
||||
doc.Save(xw);
|
||||
|
||||
xmlResult += doc.ToString();
|
||||
xmlResult += Environment.NewLine;
|
||||
}
|
||||
}
|
||||
|
||||
var filename = GetTrackMetadataFilename(artist.Path.GetRelativePath(trackFile.Path));
|
||||
|
||||
return new MetadataFileResult(filename, xmlResult.Trim(Environment.NewLine.ToCharArray()));
|
||||
}
|
||||
|
||||
public override List<ImageFileResult> ArtistImages(Artist artist)
|
||||
{
|
||||
return new List<ImageFileResult>();
|
||||
}
|
||||
|
||||
public override List<ImageFileResult> AlbumImages(Artist artist, Album album, string albumFolder)
|
||||
{
|
||||
return new List<ImageFileResult>();
|
||||
}
|
||||
|
||||
public override List<ImageFileResult> TrackImages(Artist artist, TrackFile trackFile)
|
||||
{
|
||||
return new List<ImageFileResult>();
|
||||
}
|
||||
|
||||
private string GetTrackMetadataFilename(string trackFilePath)
|
||||
{
|
||||
return Path.ChangeExtension(trackFilePath, "xml");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
using FluentValidation;
|
||||
using NzbDrone.Core.Annotations;
|
||||
using NzbDrone.Core.ThingiProvider;
|
||||
using NzbDrone.Core.Validation;
|
||||
|
||||
namespace NzbDrone.Core.Extras.Metadata.Consumers.Wdtv
|
||||
{
|
||||
public class WdtvSettingsValidator : AbstractValidator<WdtvMetadataSettings>
|
||||
{
|
||||
}
|
||||
|
||||
public class WdtvMetadataSettings : IProviderConfig
|
||||
{
|
||||
private static readonly WdtvSettingsValidator Validator = new WdtvSettingsValidator();
|
||||
|
||||
public WdtvMetadataSettings()
|
||||
{
|
||||
TrackMetadata = true;
|
||||
}
|
||||
|
||||
[FieldDefinition(0, Label = "Track Metadata", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata)]
|
||||
public bool TrackMetadata { get; set; }
|
||||
|
||||
public bool IsValid => true;
|
||||
|
||||
public NzbDroneValidationResult Validate()
|
||||
{
|
||||
return new NzbDroneValidationResult(Validator.Validate(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,252 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Core.Extras.Metadata.Files;
|
||||
using NzbDrone.Core.MediaCover;
|
||||
using NzbDrone.Core.MediaFiles;
|
||||
using NzbDrone.Core.Music;
|
||||
|
||||
namespace NzbDrone.Core.Extras.Metadata.Consumers.Xbmc
|
||||
{
|
||||
public class XbmcMetadata : MetadataBase<XbmcMetadataSettings>
|
||||
{
|
||||
private readonly Logger _logger;
|
||||
private readonly IMapCoversToLocal _mediaCoverService;
|
||||
private readonly IDetectXbmcNfo _detectNfo;
|
||||
|
||||
public XbmcMetadata(IDetectXbmcNfo detectNfo,
|
||||
IMapCoversToLocal mediaCoverService,
|
||||
Logger logger)
|
||||
{
|
||||
_logger = logger;
|
||||
_mediaCoverService = mediaCoverService;
|
||||
_detectNfo = detectNfo;
|
||||
}
|
||||
|
||||
private static readonly Regex ArtistImagesRegex = new Regex(@"^(?<type>folder|banner|fanart|logo)\.(?:png|jpg|jpeg)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private static readonly Regex AlbumImagesRegex = new Regex(@"^(?<type>cover|disc)\.(?:png|jpg|jpeg)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
public override string Name => "Kodi (XBMC) / Emby";
|
||||
|
||||
public override string GetFilenameAfterMove(Artist artist, TrackFile trackFile, MetadataFile metadataFile)
|
||||
{
|
||||
var trackFilePath = trackFile.Path;
|
||||
|
||||
if (metadataFile.Type == MetadataType.TrackMetadata)
|
||||
{
|
||||
return GetTrackMetadataFilename(trackFilePath);
|
||||
}
|
||||
|
||||
_logger.Debug("Unknown track file metadata: {0}", metadataFile.RelativePath);
|
||||
return Path.Combine(artist.Path, metadataFile.RelativePath);
|
||||
}
|
||||
|
||||
public override MetadataFile FindMetadataFile(Artist artist, string path)
|
||||
{
|
||||
var filename = Path.GetFileName(path);
|
||||
|
||||
if (filename == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var metadata = new MetadataFile
|
||||
{
|
||||
ArtistId = artist.Id,
|
||||
Consumer = GetType().Name,
|
||||
RelativePath = artist.Path.GetRelativePath(path)
|
||||
};
|
||||
|
||||
if (ArtistImagesRegex.IsMatch(filename))
|
||||
{
|
||||
metadata.Type = MetadataType.ArtistImage;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
var albumMatch = AlbumImagesRegex.Match(filename);
|
||||
|
||||
if (albumMatch.Success)
|
||||
{
|
||||
metadata.Type = MetadataType.AlbumImage;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
var isXbmcNfoFile = _detectNfo.IsXbmcNfoFile(path);
|
||||
|
||||
if (filename.Equals("artist.nfo", StringComparison.OrdinalIgnoreCase) &&
|
||||
isXbmcNfoFile)
|
||||
{
|
||||
metadata.Type = MetadataType.ArtistMetadata;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
if (filename.Equals("album.nfo", StringComparison.OrdinalIgnoreCase) &&
|
||||
isXbmcNfoFile)
|
||||
{
|
||||
metadata.Type = MetadataType.AlbumMetadata;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public override MetadataFileResult ArtistMetadata(Artist artist)
|
||||
{
|
||||
if (!Settings.ArtistMetadata)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
_logger.Debug("Generating artist.nfo for: {0}", artist.Name);
|
||||
var sb = new StringBuilder();
|
||||
var xws = new XmlWriterSettings();
|
||||
xws.OmitXmlDeclaration = true;
|
||||
xws.Indent = false;
|
||||
|
||||
using (var xw = XmlWriter.Create(sb, xws))
|
||||
{
|
||||
var artistElement = new XElement("artist");
|
||||
|
||||
artistElement.Add(new XElement("title", artist.Name));
|
||||
|
||||
if (artist.Metadata.Value.Ratings != null && artist.Metadata.Value.Ratings.Votes > 0)
|
||||
{
|
||||
artistElement.Add(new XElement("rating", artist.Metadata.Value.Ratings.Value));
|
||||
}
|
||||
|
||||
artistElement.Add(new XElement("musicbrainzartistid", artist.Metadata.Value.ForeignArtistId));
|
||||
artistElement.Add(new XElement("biography", artist.Metadata.Value.Overview));
|
||||
artistElement.Add(new XElement("outline", artist.Metadata.Value.Overview));
|
||||
|
||||
var doc = new XDocument(artistElement);
|
||||
doc.Save(xw);
|
||||
|
||||
_logger.Debug("Saving artist.nfo for {0}", artist.Metadata.Value.Name);
|
||||
|
||||
return new MetadataFileResult("artist.nfo", doc.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public override MetadataFileResult AlbumMetadata(Artist artist, Album album, string albumPath)
|
||||
{
|
||||
if (!Settings.AlbumMetadata)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
_logger.Debug("Generating album.nfo for: {0}", album.Title);
|
||||
var sb = new StringBuilder();
|
||||
var xws = new XmlWriterSettings();
|
||||
xws.OmitXmlDeclaration = true;
|
||||
xws.Indent = false;
|
||||
|
||||
using (var xw = XmlWriter.Create(sb, xws))
|
||||
{
|
||||
var albumElement = new XElement("album");
|
||||
|
||||
albumElement.Add(new XElement("title", album.Title));
|
||||
|
||||
if (album.Ratings != null && album.Ratings.Votes > 0)
|
||||
{
|
||||
albumElement.Add(new XElement("rating", album.Ratings.Value));
|
||||
}
|
||||
|
||||
albumElement.Add(new XElement("musicbrainzalbumid", album.ForeignAlbumId));
|
||||
albumElement.Add(new XElement("artistdesc", artist.Metadata.Value.Overview));
|
||||
albumElement.Add(new XElement("releasedate", album.ReleaseDate.Value.ToShortDateString()));
|
||||
|
||||
var doc = new XDocument(albumElement);
|
||||
doc.Save(xw);
|
||||
|
||||
_logger.Debug("Saving album.nfo for {0}", album.Title);
|
||||
|
||||
var fileName = Path.Combine(albumPath, "album.nfo");
|
||||
|
||||
return new MetadataFileResult(fileName, doc.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public override MetadataFileResult TrackMetadata(Artist artist, TrackFile trackFile)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public override List<ImageFileResult> ArtistImages(Artist artist)
|
||||
{
|
||||
if (!Settings.ArtistImages)
|
||||
{
|
||||
return new List<ImageFileResult>();
|
||||
}
|
||||
|
||||
return ProcessArtistImages(artist).ToList();
|
||||
}
|
||||
|
||||
public override List<ImageFileResult> AlbumImages(Artist artist, Album album, string albumPath)
|
||||
{
|
||||
if (!Settings.AlbumImages)
|
||||
{
|
||||
return new List<ImageFileResult>();
|
||||
}
|
||||
|
||||
return ProcessAlbumImages(artist, album, albumPath).ToList();
|
||||
}
|
||||
|
||||
public override List<ImageFileResult> TrackImages(Artist artist, TrackFile trackFile)
|
||||
{
|
||||
return new List<ImageFileResult>();
|
||||
}
|
||||
|
||||
private IEnumerable<ImageFileResult> ProcessArtistImages(Artist artist)
|
||||
{
|
||||
foreach (var image in artist.Metadata.Value.Images)
|
||||
{
|
||||
var source = _mediaCoverService.GetCoverPath(artist.Id, MediaCoverEntity.Artist, image.CoverType, image.Extension);
|
||||
var destination = image.CoverType.ToString().ToLowerInvariant() + image.Extension;
|
||||
if (image.CoverType == MediaCoverTypes.Poster)
|
||||
{
|
||||
destination = "folder" + image.Extension;
|
||||
}
|
||||
|
||||
yield return new ImageFileResult(destination, source);
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerable<ImageFileResult> ProcessAlbumImages(Artist artist, Album album, string albumPath)
|
||||
{
|
||||
foreach (var image in album.Images)
|
||||
{
|
||||
// TODO: Make Source fallback to URL if local does not exist
|
||||
// var source = _mediaCoverService.GetCoverPath(album.ArtistId, image.CoverType, null, album.Id);
|
||||
string filename;
|
||||
|
||||
switch (image.CoverType)
|
||||
{
|
||||
case MediaCoverTypes.Cover:
|
||||
filename = "folder";
|
||||
break;
|
||||
case MediaCoverTypes.Disc:
|
||||
filename = "discart";
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
|
||||
var destination = Path.Combine(albumPath, filename + image.Extension);
|
||||
|
||||
yield return new ImageFileResult(destination, image.Url);
|
||||
}
|
||||
}
|
||||
|
||||
private string GetTrackMetadataFilename(string trackFilePath)
|
||||
{
|
||||
return Path.ChangeExtension(trackFilePath, "nfo");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
using FluentValidation;
|
||||
using NzbDrone.Core.Annotations;
|
||||
using NzbDrone.Core.ThingiProvider;
|
||||
using NzbDrone.Core.Validation;
|
||||
|
||||
namespace NzbDrone.Core.Extras.Metadata.Consumers.Xbmc
|
||||
{
|
||||
public class XbmcSettingsValidator : AbstractValidator<XbmcMetadataSettings>
|
||||
{
|
||||
}
|
||||
|
||||
public class XbmcMetadataSettings : IProviderConfig
|
||||
{
|
||||
private static readonly XbmcSettingsValidator Validator = new XbmcSettingsValidator();
|
||||
|
||||
public XbmcMetadataSettings()
|
||||
{
|
||||
ArtistMetadata = true;
|
||||
AlbumMetadata = true;
|
||||
ArtistImages = true;
|
||||
AlbumImages = true;
|
||||
}
|
||||
|
||||
[FieldDefinition(0, Label = "Artist Metadata", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "artist.nfo")]
|
||||
public bool ArtistMetadata { get; set; }
|
||||
|
||||
[FieldDefinition(1, Label = "Album Metadata", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "album.nfo")]
|
||||
public bool AlbumMetadata { get; set; }
|
||||
|
||||
[FieldDefinition(3, Label = "Artist Images", Type = FieldType.Checkbox, Section = MetadataSectionType.Image)]
|
||||
public bool ArtistImages { get; set; }
|
||||
|
||||
[FieldDefinition(4, Label = "Album Images", Type = FieldType.Checkbox, Section = MetadataSectionType.Image)]
|
||||
public bool AlbumImages { get; set; }
|
||||
|
||||
public bool IsValid => true;
|
||||
|
||||
public NzbDroneValidationResult Validate()
|
||||
{
|
||||
return new NzbDroneValidationResult(Validator.Validate(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using NzbDrone.Common.Disk;
|
||||
|
||||
namespace NzbDrone.Core.Extras.Metadata.Consumers.Xbmc
|
||||
{
|
||||
public interface IDetectXbmcNfo
|
||||
{
|
||||
bool IsXbmcNfoFile(string path);
|
||||
}
|
||||
|
||||
public class XbmcNfoDetector : IDetectXbmcNfo
|
||||
{
|
||||
private readonly IDiskProvider _diskProvider;
|
||||
|
||||
private readonly Regex _regex = new Regex("<(movie|tvshow|episodedetails|artist|album|musicvideo)>", RegexOptions.Compiled);
|
||||
|
||||
public XbmcNfoDetector(IDiskProvider diskProvider)
|
||||
{
|
||||
_diskProvider = diskProvider;
|
||||
}
|
||||
|
||||
public bool IsXbmcNfoFile(string path)
|
||||
{
|
||||
// Lets make sure we're not reading huge files.
|
||||
if (_diskProvider.GetFileSize(path) > 10.Megabytes())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if it contains some of the kodi/xbmc xml tags
|
||||
var content = _diskProvider.ReadAllText(path);
|
||||
|
||||
return _regex.IsMatch(content);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,6 @@ using System.Linq;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Core.Extras.Files;
|
||||
using NzbDrone.Core.Extras.Lyrics;
|
||||
using NzbDrone.Core.Extras.Metadata.Files;
|
||||
using NzbDrone.Core.MediaFiles.TrackImport.Aggregation;
|
||||
using NzbDrone.Core.Music;
|
||||
@@ -37,7 +36,7 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||
|
||||
public override int Order => 0;
|
||||
|
||||
public override IEnumerable<ExtraFile> ProcessFiles(Artist artist, List<string> filesOnDisk, List<string> importedFiles)
|
||||
public override IEnumerable<ExtraFile> ProcessFiles(Author artist, List<string> filesOnDisk, List<string> importedFiles)
|
||||
{
|
||||
_logger.Debug("Looking for existing metadata in {0}", artist.Path);
|
||||
|
||||
@@ -46,12 +45,6 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||
|
||||
foreach (var possibleMetadataFile in filterResult.FilesOnDisk)
|
||||
{
|
||||
// Don't process files that have known Subtitle file extensions (saves a bit of unecessary processing)
|
||||
if (LyricFileExtensions.Extensions.Contains(Path.GetExtension(possibleMetadataFile)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach (var consumer in _consumers)
|
||||
{
|
||||
var metadata = consumer.FindMetadataFile(artist, possibleMetadataFile);
|
||||
@@ -71,7 +64,7 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||
continue;
|
||||
}
|
||||
|
||||
metadata.AlbumId = localAlbum.Id;
|
||||
metadata.BookId = localAlbum.Id;
|
||||
}
|
||||
|
||||
if (metadata.Type == MetadataType.TrackMetadata)
|
||||
@@ -93,19 +86,11 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||
continue;
|
||||
}
|
||||
|
||||
if (localTrack.Tracks.Empty())
|
||||
if (localTrack.Album == null)
|
||||
{
|
||||
_logger.Debug("Cannot find related tracks for: {0}", possibleMetadataFile);
|
||||
_logger.Debug("Cannot find related book for: {0}", possibleMetadataFile);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (localTrack.Tracks.DistinctBy(e => e.TrackFileId).Count() > 1)
|
||||
{
|
||||
_logger.Debug("Extra file: {0} does not match existing files.", possibleMetadataFile);
|
||||
continue;
|
||||
}
|
||||
|
||||
metadata.TrackFileId = localTrack.Tracks.First().TrackFileId;
|
||||
}
|
||||
|
||||
metadata.Extension = Path.GetExtension(possibleMetadataFile);
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace NzbDrone.Core.Extras.Metadata.Files
|
||||
{
|
||||
public interface ICleanMetadataService
|
||||
{
|
||||
void Clean(Artist artist);
|
||||
void Clean(Author artist);
|
||||
}
|
||||
|
||||
public class CleanExtraFileService : ICleanMetadataService
|
||||
@@ -25,7 +25,7 @@ namespace NzbDrone.Core.Extras.Metadata.Files
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public void Clean(Artist artist)
|
||||
public void Clean(Author artist)
|
||||
{
|
||||
_logger.Debug("Cleaning missing metadata files for artist: {0}", artist.Name);
|
||||
|
||||
|
||||
@@ -8,14 +8,14 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||
{
|
||||
public interface IMetadata : IProvider
|
||||
{
|
||||
string GetFilenameAfterMove(Artist artist, TrackFile trackFile, MetadataFile metadataFile);
|
||||
string GetFilenameAfterMove(Artist artist, string albumPath, MetadataFile metadataFile);
|
||||
MetadataFile FindMetadataFile(Artist artist, string path);
|
||||
MetadataFileResult ArtistMetadata(Artist artist);
|
||||
MetadataFileResult AlbumMetadata(Artist artist, Album album, string albumPath);
|
||||
MetadataFileResult TrackMetadata(Artist artist, TrackFile trackFile);
|
||||
List<ImageFileResult> ArtistImages(Artist artist);
|
||||
List<ImageFileResult> AlbumImages(Artist artist, Album album, string albumPath);
|
||||
List<ImageFileResult> TrackImages(Artist artist, TrackFile trackFile);
|
||||
string GetFilenameAfterMove(Author artist, BookFile trackFile, MetadataFile metadataFile);
|
||||
string GetFilenameAfterMove(Author artist, string albumPath, MetadataFile metadataFile);
|
||||
MetadataFile FindMetadataFile(Author artist, string path);
|
||||
MetadataFileResult ArtistMetadata(Author artist);
|
||||
MetadataFileResult AlbumMetadata(Author artist, Book album, string albumPath);
|
||||
MetadataFileResult TrackMetadata(Author artist, BookFile trackFile);
|
||||
List<ImageFileResult> ArtistImages(Author artist);
|
||||
List<ImageFileResult> AlbumImages(Author artist, Book album, string albumPath);
|
||||
List<ImageFileResult> TrackImages(Author artist, BookFile trackFile);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||
return new ValidationResult();
|
||||
}
|
||||
|
||||
public virtual string GetFilenameAfterMove(Artist artist, TrackFile trackFile, MetadataFile metadataFile)
|
||||
public virtual string GetFilenameAfterMove(Author artist, BookFile trackFile, MetadataFile metadataFile)
|
||||
{
|
||||
var existingFilename = Path.Combine(artist.Path, metadataFile.RelativePath);
|
||||
var extension = Path.GetExtension(existingFilename).TrimStart('.');
|
||||
@@ -36,7 +36,7 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||
return newFileName;
|
||||
}
|
||||
|
||||
public virtual string GetFilenameAfterMove(Artist artist, string albumPath, MetadataFile metadataFile)
|
||||
public virtual string GetFilenameAfterMove(Author artist, string albumPath, MetadataFile metadataFile)
|
||||
{
|
||||
var existingFilename = Path.GetFileName(metadataFile.RelativePath);
|
||||
var newFileName = Path.Combine(artist.Path, albumPath, existingFilename);
|
||||
@@ -44,14 +44,14 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||
return newFileName;
|
||||
}
|
||||
|
||||
public abstract MetadataFile FindMetadataFile(Artist artist, string path);
|
||||
public abstract MetadataFile FindMetadataFile(Author artist, string path);
|
||||
|
||||
public abstract MetadataFileResult ArtistMetadata(Artist artist);
|
||||
public abstract MetadataFileResult AlbumMetadata(Artist artist, Album album, string albumPath);
|
||||
public abstract MetadataFileResult TrackMetadata(Artist artist, TrackFile trackFile);
|
||||
public abstract List<ImageFileResult> ArtistImages(Artist artist);
|
||||
public abstract List<ImageFileResult> AlbumImages(Artist artist, Album album, string albumPath);
|
||||
public abstract List<ImageFileResult> TrackImages(Artist artist, TrackFile trackFile);
|
||||
public abstract MetadataFileResult ArtistMetadata(Author artist);
|
||||
public abstract MetadataFileResult AlbumMetadata(Author artist, Book album, string albumPath);
|
||||
public abstract MetadataFileResult TrackMetadata(Author artist, BookFile trackFile);
|
||||
public abstract List<ImageFileResult> ArtistImages(Author artist);
|
||||
public abstract List<ImageFileResult> AlbumImages(Author artist, Book album, string albumPath);
|
||||
public abstract List<ImageFileResult> TrackImages(Author artist, BookFile trackFile);
|
||||
|
||||
public virtual object RequestAction(string action, IDictionary<string, string> query)
|
||||
{
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||
|
||||
public override int Order => 0;
|
||||
|
||||
public override IEnumerable<ExtraFile> CreateAfterArtistScan(Artist artist, List<TrackFile> trackFiles)
|
||||
public override IEnumerable<ExtraFile> CreateAfterArtistScan(Author artist, List<BookFile> trackFiles)
|
||||
{
|
||||
var metadataFiles = _metadataFileService.GetFilesByArtist(artist.Id);
|
||||
_cleanMetadataService.Clean(artist);
|
||||
@@ -83,7 +83,7 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||
|
||||
foreach (var group in albumGroups)
|
||||
{
|
||||
var album = _albumService.GetAlbum(group.First().AlbumId);
|
||||
var album = _albumService.GetAlbum(group.First().BookId);
|
||||
var albumFolder = group.Key;
|
||||
files.AddIfNotNull(ProcessAlbumMetadata(consumer, artist, album, albumFolder, consumerFiles));
|
||||
files.AddRange(ProcessAlbumImages(consumer, artist, album, albumFolder, consumerFiles));
|
||||
@@ -100,7 +100,7 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||
return files;
|
||||
}
|
||||
|
||||
public override IEnumerable<ExtraFile> CreateAfterTrackImport(Artist artist, TrackFile trackFile)
|
||||
public override IEnumerable<ExtraFile> CreateAfterTrackImport(Author artist, BookFile trackFile)
|
||||
{
|
||||
var files = new List<MetadataFile>();
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||
return files;
|
||||
}
|
||||
|
||||
public override IEnumerable<ExtraFile> CreateAfterTrackImport(Artist artist, Album album, string artistFolder, string albumFolder)
|
||||
public override IEnumerable<ExtraFile> CreateAfterTrackImport(Author artist, Book album, string artistFolder, string albumFolder)
|
||||
{
|
||||
var metadataFiles = _metadataFileService.GetFilesByArtist(artist.Id);
|
||||
|
||||
@@ -141,7 +141,7 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||
return files;
|
||||
}
|
||||
|
||||
public override IEnumerable<ExtraFile> MoveFilesAfterRename(Artist artist, List<TrackFile> trackFiles)
|
||||
public override IEnumerable<ExtraFile> MoveFilesAfterRename(Author artist, List<BookFile> trackFiles)
|
||||
{
|
||||
var metadataFiles = _metadataFileService.GetFilesByArtist(artist.Id);
|
||||
var movedFiles = new List<MetadataFile>();
|
||||
@@ -154,7 +154,7 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||
foreach (var filePath in distinctTrackFilePaths)
|
||||
{
|
||||
var metadataFilesForConsumer = GetMetadataFilesForConsumer(consumer, metadataFiles)
|
||||
.Where(m => m.AlbumId == filePath.AlbumId)
|
||||
.Where(m => m.BookId == filePath.BookId)
|
||||
.Where(m => m.Type == MetadataType.AlbumImage || m.Type == MetadataType.AlbumMetadata)
|
||||
.ToList();
|
||||
|
||||
@@ -210,7 +210,7 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||
return movedFiles;
|
||||
}
|
||||
|
||||
public override ExtraFile Import(Artist artist, TrackFile trackFile, string path, string extension, bool readOnly)
|
||||
public override ExtraFile Import(Author artist, BookFile trackFile, string path, string extension, bool readOnly)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -220,7 +220,7 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||
return artistMetadata.Where(c => c.Consumer == consumer.GetType().Name).ToList();
|
||||
}
|
||||
|
||||
private MetadataFile ProcessArtistMetadata(IMetadata consumer, Artist artist, List<MetadataFile> existingMetadataFiles)
|
||||
private MetadataFile ProcessArtistMetadata(IMetadata consumer, Author artist, List<MetadataFile> existingMetadataFiles)
|
||||
{
|
||||
var artistMetadata = consumer.ArtistMetadata(artist);
|
||||
|
||||
@@ -234,7 +234,7 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||
var metadata = GetMetadataFile(artist, existingMetadataFiles, e => e.Type == MetadataType.ArtistMetadata) ??
|
||||
new MetadataFile
|
||||
{
|
||||
ArtistId = artist.Id,
|
||||
AuthorId = artist.Id,
|
||||
Consumer = consumer.GetType().Name,
|
||||
Type = MetadataType.ArtistMetadata
|
||||
};
|
||||
@@ -265,7 +265,7 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||
return metadata;
|
||||
}
|
||||
|
||||
private MetadataFile ProcessAlbumMetadata(IMetadata consumer, Artist artist, Album album, string albumPath, List<MetadataFile> existingMetadataFiles)
|
||||
private MetadataFile ProcessAlbumMetadata(IMetadata consumer, Author artist, Book album, string albumPath, List<MetadataFile> existingMetadataFiles)
|
||||
{
|
||||
var albumMetadata = consumer.AlbumMetadata(artist, album, albumPath);
|
||||
|
||||
@@ -276,11 +276,11 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||
|
||||
var hash = albumMetadata.Contents.SHA256Hash();
|
||||
|
||||
var metadata = GetMetadataFile(artist, existingMetadataFiles, e => e.Type == MetadataType.AlbumMetadata && e.AlbumId == album.Id) ??
|
||||
var metadata = GetMetadataFile(artist, existingMetadataFiles, e => e.Type == MetadataType.AlbumMetadata && e.BookId == album.Id) ??
|
||||
new MetadataFile
|
||||
{
|
||||
ArtistId = artist.Id,
|
||||
AlbumId = album.Id,
|
||||
AuthorId = artist.Id,
|
||||
BookId = album.Id,
|
||||
Consumer = consumer.GetType().Name,
|
||||
Type = MetadataType.AlbumMetadata
|
||||
};
|
||||
@@ -311,7 +311,7 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||
return metadata;
|
||||
}
|
||||
|
||||
private MetadataFile ProcessTrackMetadata(IMetadata consumer, Artist artist, TrackFile trackFile, List<MetadataFile> existingMetadataFiles)
|
||||
private MetadataFile ProcessTrackMetadata(IMetadata consumer, Author artist, BookFile trackFile, List<MetadataFile> existingMetadataFiles)
|
||||
{
|
||||
var trackMetadata = consumer.TrackMetadata(artist, trackFile);
|
||||
|
||||
@@ -342,8 +342,8 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||
var metadata = existingMetadata ??
|
||||
new MetadataFile
|
||||
{
|
||||
ArtistId = artist.Id,
|
||||
AlbumId = trackFile.AlbumId,
|
||||
AuthorId = artist.Id,
|
||||
BookId = trackFile.BookId,
|
||||
TrackFileId = trackFile.Id,
|
||||
Consumer = consumer.GetType().Name,
|
||||
Type = MetadataType.TrackMetadata,
|
||||
@@ -364,7 +364,7 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||
return metadata;
|
||||
}
|
||||
|
||||
private List<MetadataFile> ProcessArtistImages(IMetadata consumer, Artist artist, List<MetadataFile> existingMetadataFiles)
|
||||
private List<MetadataFile> ProcessArtistImages(IMetadata consumer, Author artist, List<MetadataFile> existingMetadataFiles)
|
||||
{
|
||||
var result = new List<MetadataFile>();
|
||||
|
||||
@@ -384,7 +384,7 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||
c.RelativePath == image.RelativePath) ??
|
||||
new MetadataFile
|
||||
{
|
||||
ArtistId = artist.Id,
|
||||
AuthorId = artist.Id,
|
||||
Consumer = consumer.GetType().Name,
|
||||
Type = MetadataType.ArtistImage,
|
||||
RelativePath = image.RelativePath,
|
||||
@@ -399,7 +399,7 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<MetadataFile> ProcessAlbumImages(IMetadata consumer, Artist artist, Album album, string albumFolder, List<MetadataFile> existingMetadataFiles)
|
||||
private List<MetadataFile> ProcessAlbumImages(IMetadata consumer, Author artist, Book album, string albumFolder, List<MetadataFile> existingMetadataFiles)
|
||||
{
|
||||
var result = new List<MetadataFile>();
|
||||
|
||||
@@ -416,12 +416,12 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||
_otherExtraFileRenamer.RenameOtherExtraFile(artist, fullPath);
|
||||
|
||||
var metadata = GetMetadataFile(artist, existingMetadataFiles, c => c.Type == MetadataType.AlbumImage &&
|
||||
c.AlbumId == album.Id &&
|
||||
c.BookId == album.Id &&
|
||||
c.RelativePath == image.RelativePath) ??
|
||||
new MetadataFile
|
||||
{
|
||||
ArtistId = artist.Id,
|
||||
AlbumId = album.Id,
|
||||
AuthorId = artist.Id,
|
||||
BookId = album.Id,
|
||||
Consumer = consumer.GetType().Name,
|
||||
Type = MetadataType.AlbumImage,
|
||||
RelativePath = image.RelativePath,
|
||||
@@ -436,7 +436,7 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||
return result;
|
||||
}
|
||||
|
||||
private void DownloadImage(Artist artist, ImageFileResult image)
|
||||
private void DownloadImage(Author artist, ImageFileResult image)
|
||||
{
|
||||
var fullPath = Path.Combine(artist.Path, image.RelativePath);
|
||||
|
||||
@@ -469,7 +469,7 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||
_mediaFileAttributeService.SetFilePermissions(path);
|
||||
}
|
||||
|
||||
private MetadataFile GetMetadataFile(Artist artist, List<MetadataFile> existingMetadataFiles, Func<MetadataFile, bool> predicate)
|
||||
private MetadataFile GetMetadataFile(Author artist, List<MetadataFile> existingMetadataFiles, Func<MetadataFile, bool> predicate)
|
||||
{
|
||||
var matchingMetadataFiles = existingMetadataFiles.Where(predicate).ToList();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user