mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-27 22:56:45 -04:00
New: Readarr 0.1
This commit is contained in:
@@ -28,7 +28,7 @@ namespace NzbDrone.Core.Extras.Others
|
||||
|
||||
public override int Order => 2;
|
||||
|
||||
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 extra files in {0}", artist.Path);
|
||||
|
||||
@@ -62,23 +62,16 @@ namespace NzbDrone.Core.Extras.Others
|
||||
continue;
|
||||
}
|
||||
|
||||
if (localTrack.Tracks.Empty())
|
||||
if (localTrack.Album == null)
|
||||
{
|
||||
_logger.Debug("Cannot find related tracks for: {0}", possibleExtraFile);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (localTrack.Tracks.DistinctBy(e => e.TrackFileId).Count() > 1)
|
||||
{
|
||||
_logger.Debug("Extra file: {0} does not match existing files.", possibleExtraFile);
|
||||
_logger.Debug("Cannot find related book for: {0}", possibleExtraFile);
|
||||
continue;
|
||||
}
|
||||
|
||||
var extraFile = new OtherExtraFile
|
||||
{
|
||||
ArtistId = artist.Id,
|
||||
AlbumId = localTrack.Album.Id,
|
||||
TrackFileId = localTrack.Tracks.First().TrackFileId,
|
||||
AuthorId = artist.Id,
|
||||
BookId = localTrack.Album.Id,
|
||||
RelativePath = artist.Path.GetRelativePath(possibleExtraFile),
|
||||
Extension = extension
|
||||
};
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace NzbDrone.Core.Extras.Others
|
||||
{
|
||||
public interface IOtherExtraFileRenamer
|
||||
{
|
||||
void RenameOtherExtraFile(Artist artist, string path);
|
||||
void RenameOtherExtraFile(Author artist, string path);
|
||||
}
|
||||
|
||||
public class OtherExtraFileRenamer : IOtherExtraFileRenamer
|
||||
@@ -33,7 +33,7 @@ namespace NzbDrone.Core.Extras.Others
|
||||
_otherExtraFileService = otherExtraFileService;
|
||||
}
|
||||
|
||||
public void RenameOtherExtraFile(Artist artist, string path)
|
||||
public void RenameOtherExtraFile(Author artist, string path)
|
||||
{
|
||||
if (!_diskProvider.FileExists(path))
|
||||
{
|
||||
@@ -58,7 +58,7 @@ namespace NzbDrone.Core.Extras.Others
|
||||
}
|
||||
}
|
||||
|
||||
private void RemoveOtherExtraFile(Artist artist, string path)
|
||||
private void RemoveOtherExtraFile(Author artist, string path)
|
||||
{
|
||||
if (!_diskProvider.FileExists(path))
|
||||
{
|
||||
|
||||
@@ -26,22 +26,22 @@ namespace NzbDrone.Core.Extras.Others
|
||||
|
||||
public override int Order => 2;
|
||||
|
||||
public override IEnumerable<ExtraFile> CreateAfterArtistScan(Artist artist, List<TrackFile> trackFiles)
|
||||
public override IEnumerable<ExtraFile> CreateAfterArtistScan(Author artist, List<BookFile> trackFiles)
|
||||
{
|
||||
return Enumerable.Empty<ExtraFile>();
|
||||
}
|
||||
|
||||
public override IEnumerable<ExtraFile> CreateAfterTrackImport(Artist artist, TrackFile trackFile)
|
||||
public override IEnumerable<ExtraFile> CreateAfterTrackImport(Author artist, BookFile trackFile)
|
||||
{
|
||||
return Enumerable.Empty<ExtraFile>();
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return Enumerable.Empty<ExtraFile>();
|
||||
}
|
||||
|
||||
public override IEnumerable<ExtraFile> MoveFilesAfterRename(Artist artist, List<TrackFile> trackFiles)
|
||||
public override IEnumerable<ExtraFile> MoveFilesAfterRename(Author artist, List<BookFile> trackFiles)
|
||||
{
|
||||
var extraFiles = _otherExtraFileService.GetFilesByArtist(artist.Id);
|
||||
var movedFiles = new List<OtherExtraFile>();
|
||||
@@ -61,7 +61,7 @@ namespace NzbDrone.Core.Extras.Others
|
||||
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)
|
||||
{
|
||||
var extraFile = ImportFile(artist, trackFile, path, readOnly, extension, null);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user