File tree 3 files changed +8
-8
lines changed
3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ public interface IExtraFileRepository<TExtraFile> : IBasicRepository<TExtraFile>
14
14
List < TExtraFile > GetFilesByArtist ( int artistId ) ;
15
15
List < TExtraFile > GetFilesByAlbum ( int artistId , int albumId ) ;
16
16
List < TExtraFile > GetFilesByTrackFile ( int trackFileId ) ;
17
- TExtraFile FindByPath ( string path ) ;
17
+ TExtraFile FindByPath ( int artistId , string path ) ;
18
18
}
19
19
20
20
public class ExtraFileRepository < TExtraFile > : BasicRepository < TExtraFile > , IExtraFileRepository < TExtraFile >
@@ -55,9 +55,9 @@ public List<TExtraFile> GetFilesByTrackFile(int trackFileId)
55
55
return Query ( c => c . TrackFileId == trackFileId ) ;
56
56
}
57
57
58
- public TExtraFile FindByPath ( string path )
58
+ public TExtraFile FindByPath ( int artistId , string path )
59
59
{
60
- return Query ( c => c . RelativePath == path ) . SingleOrDefault ( ) ;
60
+ return Query ( c => c . ArtistId == artistId && c . RelativePath == path ) . SingleOrDefault ( ) ;
61
61
}
62
62
}
63
63
}
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ public interface IExtraFileService<TExtraFile>
18
18
{
19
19
List < TExtraFile > GetFilesByArtist ( int artistId ) ;
20
20
List < TExtraFile > GetFilesByTrackFile ( int trackFileId ) ;
21
- TExtraFile FindByPath ( string path ) ;
21
+ TExtraFile FindByPath ( int artistId , string path ) ;
22
22
void Upsert ( TExtraFile extraFile ) ;
23
23
void Upsert ( List < TExtraFile > extraFiles ) ;
24
24
void Delete ( int id ) ;
@@ -59,9 +59,9 @@ public List<TExtraFile> GetFilesByTrackFile(int trackFileId)
59
59
return _repository . GetFilesByTrackFile ( trackFileId ) ;
60
60
}
61
61
62
- public TExtraFile FindByPath ( string path )
62
+ public TExtraFile FindByPath ( int artistId , string path )
63
63
{
64
- return _repository . FindByPath ( path ) ;
64
+ return _repository . FindByPath ( artistId , path ) ;
65
65
}
66
66
67
67
public void Upsert ( TExtraFile extraFile )
Original file line number Diff line number Diff line change @@ -41,8 +41,8 @@ public void RenameOtherExtraFile(Artist artist, string path)
41
41
}
42
42
43
43
var relativePath = artist . Path . GetRelativePath ( path ) ;
44
+ var otherExtraFile = _otherExtraFileService . FindByPath ( artist . Id , relativePath ) ;
44
45
45
- var otherExtraFile = _otherExtraFileService . FindByPath ( relativePath ) ;
46
46
if ( otherExtraFile != null )
47
47
{
48
48
var newPath = path + "-orig" ;
@@ -66,8 +66,8 @@ private void RemoveOtherExtraFile(Artist artist, string path)
66
66
}
67
67
68
68
var relativePath = artist . Path . GetRelativePath ( path ) ;
69
+ var otherExtraFile = _otherExtraFileService . FindByPath ( artist . Id , relativePath ) ;
69
70
70
- var otherExtraFile = _otherExtraFileService . FindByPath ( relativePath ) ;
71
71
if ( otherExtraFile != null )
72
72
{
73
73
var subfolder = Path . GetDirectoryName ( relativePath ) ;
You can’t perform that action at this time.
0 commit comments