mirror of
https://github.com/Readarr/Readarr
synced 2026-02-03 13:23:41 +01:00
Fixed: UpdateAlbums was a duplicate of UpdateMany
This commit is contained in:
parent
76db27e8c2
commit
f5c1858d4c
3 changed files with 5 additions and 16 deletions
|
|
@ -60,7 +60,7 @@ public void should_be_able_to_monitor_artist_without_changing_albums()
|
|||
.Verify(v => v.UpdateArtist(It.IsAny<Artist>()), Times.Once());
|
||||
|
||||
Mocker.GetMock<IAlbumService>()
|
||||
.Verify(v => v.UpdateAlbums(It.IsAny<List<Album>>()), Times.Never());
|
||||
.Verify(v => v.UpdateMany(It.IsAny<List<Album>>()), Times.Never());
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
@ -83,7 +83,7 @@ public void should_be_able_to_monitor_all_albums()
|
|||
Subject.SetAlbumMonitoredStatus(_artist, new MonitoringOptions{Monitor = MonitorTypes.All});
|
||||
|
||||
Mocker.GetMock<IAlbumService>()
|
||||
.Verify(v => v.UpdateAlbums(It.Is<List<Album>>(l => l.All(e => e.Monitored))));
|
||||
.Verify(v => v.UpdateMany(It.Is<List<Album>>(l => l.All(e => e.Monitored))));
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
@ -104,13 +104,13 @@ public void should_be_able_to_monitor_new_albums_only()
|
|||
private void VerifyMonitored(Func<Album, bool> predicate)
|
||||
{
|
||||
Mocker.GetMock<IAlbumService>()
|
||||
.Verify(v => v.UpdateAlbums(It.Is<List<Album>>(l => l.Where(predicate).All(e => e.Monitored))));
|
||||
.Verify(v => v.UpdateMany(It.Is<List<Album>>(l => l.Where(predicate).All(e => e.Monitored))));
|
||||
}
|
||||
|
||||
private void VerifyNotMonitored(Func<Album, bool> predicate)
|
||||
{
|
||||
Mocker.GetMock<IAlbumService>()
|
||||
.Verify(v => v.UpdateAlbums(It.Is<List<Album>>(l => l.Where(predicate).All(e => !e.Monitored))));
|
||||
.Verify(v => v.UpdateMany(It.Is<List<Album>>(l => l.Where(predicate).All(e => !e.Monitored))));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ public void SetAlbumMonitoredStatus(Artist artist, MonitoringOptions monitoringO
|
|||
}
|
||||
}
|
||||
|
||||
_albumService.UpdateAlbums(albums);
|
||||
_albumService.UpdateMany(albums);
|
||||
}
|
||||
|
||||
_artistService.UpdateArtist(artist);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ public interface IAlbumService
|
|||
void DeleteAlbum(int albumId, bool deleteFiles);
|
||||
List<Album> GetAllAlbums();
|
||||
Album UpdateAlbum(Album album);
|
||||
List<Album> UpdateAlbums(List<Album> album);
|
||||
void SetAlbumMonitored(int albumId, bool monitored);
|
||||
void SetMonitored(IEnumerable<int> ids, bool monitored);
|
||||
PagingSpec<Album> AlbumsWithoutFiles(PagingSpec<Album> pagingSpec);
|
||||
|
|
@ -280,16 +279,6 @@ public void SetMonitored(IEnumerable<int> ids, bool monitored)
|
|||
}
|
||||
}
|
||||
|
||||
public List<Album> UpdateAlbums(List<Album> albums)
|
||||
{
|
||||
_logger.Debug("Updating {0} albums", albums.Count);
|
||||
|
||||
_albumRepository.UpdateMany(albums);
|
||||
_logger.Debug("{0} albums updated", albums.Count);
|
||||
|
||||
return albums;
|
||||
}
|
||||
|
||||
public void Handle(ArtistDeletedEvent message)
|
||||
{
|
||||
var albums = GetAlbumsByArtistMetadataId(message.Artist.ArtistMetadataId);
|
||||
|
|
|
|||
Loading…
Reference in a new issue