diff --git a/src/NzbDrone.Core/Extras/Files/ExtraFileRepository.cs b/src/NzbDrone.Core/Extras/Files/ExtraFileRepository.cs index 5d88a9a36..a056ca106 100644 --- a/src/NzbDrone.Core/Extras/Files/ExtraFileRepository.cs +++ b/src/NzbDrone.Core/Extras/Files/ExtraFileRepository.cs @@ -14,7 +14,7 @@ namespace NzbDrone.Core.Extras.Files List GetFilesByArtist(int artistId); List GetFilesByAlbum(int artistId, int albumId); List GetFilesByTrackFile(int trackFileId); - TExtraFile FindByPath(string path); + TExtraFile FindByPath(int artistId, string path); } public class ExtraFileRepository : BasicRepository, IExtraFileRepository @@ -55,9 +55,9 @@ namespace NzbDrone.Core.Extras.Files return Query(c => c.TrackFileId == trackFileId); } - public TExtraFile FindByPath(string path) + public TExtraFile FindByPath(int artistId, string path) { - return Query(c => c.RelativePath == path).SingleOrDefault(); + return Query(c => c.ArtistId == artistId && c.RelativePath == path).SingleOrDefault(); } } } diff --git a/src/NzbDrone.Core/Extras/Files/ExtraFileService.cs b/src/NzbDrone.Core/Extras/Files/ExtraFileService.cs index a1c113a39..3f02432e0 100644 --- a/src/NzbDrone.Core/Extras/Files/ExtraFileService.cs +++ b/src/NzbDrone.Core/Extras/Files/ExtraFileService.cs @@ -18,7 +18,7 @@ namespace NzbDrone.Core.Extras.Files { List GetFilesByArtist(int artistId); List GetFilesByTrackFile(int trackFileId); - TExtraFile FindByPath(string path); + TExtraFile FindByPath(int artistId, string path); void Upsert(TExtraFile extraFile); void Upsert(List extraFiles); void Delete(int id); @@ -59,9 +59,9 @@ namespace NzbDrone.Core.Extras.Files return _repository.GetFilesByTrackFile(trackFileId); } - public TExtraFile FindByPath(string path) + public TExtraFile FindByPath(int artistId, string path) { - return _repository.FindByPath(path); + return _repository.FindByPath(artistId, path); } public void Upsert(TExtraFile extraFile) diff --git a/src/NzbDrone.Core/Extras/Others/OtherExtraFileRenamer.cs b/src/NzbDrone.Core/Extras/Others/OtherExtraFileRenamer.cs index b5f321e61..542684e18 100644 --- a/src/NzbDrone.Core/Extras/Others/OtherExtraFileRenamer.cs +++ b/src/NzbDrone.Core/Extras/Others/OtherExtraFileRenamer.cs @@ -41,8 +41,8 @@ namespace NzbDrone.Core.Extras.Others } var relativePath = artist.Path.GetRelativePath(path); + var otherExtraFile = _otherExtraFileService.FindByPath(artist.Id, relativePath); - var otherExtraFile = _otherExtraFileService.FindByPath(relativePath); if (otherExtraFile != null) { var newPath = path + "-orig"; @@ -66,8 +66,8 @@ namespace NzbDrone.Core.Extras.Others } var relativePath = artist.Path.GetRelativePath(path); + var otherExtraFile = _otherExtraFileService.FindByPath(artist.Id, relativePath); - var otherExtraFile = _otherExtraFileService.FindByPath(relativePath); if (otherExtraFile != null) { var subfolder = Path.GetDirectoryName(relativePath);