mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07: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 @@ namespace NzbDrone.Core.Test.MusicTests.AlbumMonitoredServiceTests
|
||||||
.Verify(v => v.UpdateArtist(It.IsAny<Artist>()), Times.Once());
|
.Verify(v => v.UpdateArtist(It.IsAny<Artist>()), Times.Once());
|
||||||
|
|
||||||
Mocker.GetMock<IAlbumService>()
|
Mocker.GetMock<IAlbumService>()
|
||||||
.Verify(v => v.UpdateAlbums(It.IsAny<List<Album>>()), Times.Never());
|
.Verify(v => v.UpdateMany(It.IsAny<List<Album>>()), Times.Never());
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -83,7 +83,7 @@ namespace NzbDrone.Core.Test.MusicTests.AlbumMonitoredServiceTests
|
||||||
Subject.SetAlbumMonitoredStatus(_artist, new MonitoringOptions{Monitor = MonitorTypes.All});
|
Subject.SetAlbumMonitoredStatus(_artist, new MonitoringOptions{Monitor = MonitorTypes.All});
|
||||||
|
|
||||||
Mocker.GetMock<IAlbumService>()
|
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]
|
[Test]
|
||||||
|
@ -104,13 +104,13 @@ namespace NzbDrone.Core.Test.MusicTests.AlbumMonitoredServiceTests
|
||||||
private void VerifyMonitored(Func<Album, bool> predicate)
|
private void VerifyMonitored(Func<Album, bool> predicate)
|
||||||
{
|
{
|
||||||
Mocker.GetMock<IAlbumService>()
|
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)
|
private void VerifyNotMonitored(Func<Album, bool> predicate)
|
||||||
{
|
{
|
||||||
Mocker.GetMock<IAlbumService>()
|
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 @@ namespace NzbDrone.Core.Music
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_albumService.UpdateAlbums(albums);
|
_albumService.UpdateMany(albums);
|
||||||
}
|
}
|
||||||
|
|
||||||
_artistService.UpdateArtist(artist);
|
_artistService.UpdateArtist(artist);
|
||||||
|
|
|
@ -25,7 +25,6 @@ namespace NzbDrone.Core.Music
|
||||||
void DeleteAlbum(int albumId, bool deleteFiles);
|
void DeleteAlbum(int albumId, bool deleteFiles);
|
||||||
List<Album> GetAllAlbums();
|
List<Album> GetAllAlbums();
|
||||||
Album UpdateAlbum(Album album);
|
Album UpdateAlbum(Album album);
|
||||||
List<Album> UpdateAlbums(List<Album> album);
|
|
||||||
void SetAlbumMonitored(int albumId, bool monitored);
|
void SetAlbumMonitored(int albumId, bool monitored);
|
||||||
void SetMonitored(IEnumerable<int> ids, bool monitored);
|
void SetMonitored(IEnumerable<int> ids, bool monitored);
|
||||||
PagingSpec<Album> AlbumsWithoutFiles(PagingSpec<Album> pagingSpec);
|
PagingSpec<Album> AlbumsWithoutFiles(PagingSpec<Album> pagingSpec);
|
||||||
|
@ -280,16 +279,6 @@ namespace NzbDrone.Core.Music
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
public void Handle(ArtistDeletedEvent message)
|
||||||
{
|
{
|
||||||
var albums = GetAlbumsByArtistMetadataId(message.Artist.ArtistMetadataId);
|
var albums = GetAlbumsByArtistMetadataId(message.Artist.ArtistMetadataId);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue