mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-20 21:54:25 -04:00
Fixed: A potential issue when extra files for multiple authors have the same relative path
(cherry picked from commit a6a68b4cae7688506c45ff6cf10989fe6596c274) Closes #1650
This commit is contained in:
@@ -14,7 +14,7 @@ namespace NzbDrone.Core.Extras.Files
|
||||
List<TExtraFile> GetFilesByAuthor(int authorId);
|
||||
List<TExtraFile> GetFilesByBook(int authorId, int bookId);
|
||||
List<TExtraFile> GetFilesByBookFile(int bookFileId);
|
||||
TExtraFile FindByPath(string path);
|
||||
TExtraFile FindByPath(int authorId, string path);
|
||||
}
|
||||
|
||||
public class ExtraFileRepository<TExtraFile> : BasicRepository<TExtraFile>, IExtraFileRepository<TExtraFile>
|
||||
@@ -55,9 +55,9 @@ namespace NzbDrone.Core.Extras.Files
|
||||
return Query(c => c.BookFileId == bookFileId);
|
||||
}
|
||||
|
||||
public TExtraFile FindByPath(string path)
|
||||
public TExtraFile FindByPath(int authorId, string path)
|
||||
{
|
||||
return Query(c => c.RelativePath == path).SingleOrDefault();
|
||||
return Query(c => c.AuthorId == authorId && c.RelativePath == path).SingleOrDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user