From f5c1858d4c027444fd21c1f4e1ee90e0c10bf617 Mon Sep 17 00:00:00 2001 From: ta264 Date: Tue, 9 Jul 2019 21:13:52 +0100 Subject: [PATCH] Fixed: UpdateAlbums was a duplicate of UpdateMany --- .../AlbumMonitoredServiceFixture.cs | 8 ++++---- src/NzbDrone.Core/Music/AlbumMonitoredService.cs | 2 +- src/NzbDrone.Core/Music/AlbumService.cs | 11 ----------- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/NzbDrone.Core.Test/MusicTests/AlbumMonitoredServiceTests/AlbumMonitoredServiceFixture.cs b/src/NzbDrone.Core.Test/MusicTests/AlbumMonitoredServiceTests/AlbumMonitoredServiceFixture.cs index 31019c6e2..9d8fd0052 100644 --- a/src/NzbDrone.Core.Test/MusicTests/AlbumMonitoredServiceTests/AlbumMonitoredServiceFixture.cs +++ b/src/NzbDrone.Core.Test/MusicTests/AlbumMonitoredServiceTests/AlbumMonitoredServiceFixture.cs @@ -60,7 +60,7 @@ namespace NzbDrone.Core.Test.MusicTests.AlbumMonitoredServiceTests .Verify(v => v.UpdateArtist(It.IsAny()), Times.Once()); Mocker.GetMock() - .Verify(v => v.UpdateAlbums(It.IsAny>()), Times.Never()); + .Verify(v => v.UpdateMany(It.IsAny>()), Times.Never()); } [Test] @@ -83,7 +83,7 @@ namespace NzbDrone.Core.Test.MusicTests.AlbumMonitoredServiceTests Subject.SetAlbumMonitoredStatus(_artist, new MonitoringOptions{Monitor = MonitorTypes.All}); Mocker.GetMock() - .Verify(v => v.UpdateAlbums(It.Is>(l => l.All(e => e.Monitored)))); + .Verify(v => v.UpdateMany(It.Is>(l => l.All(e => e.Monitored)))); } [Test] @@ -104,13 +104,13 @@ namespace NzbDrone.Core.Test.MusicTests.AlbumMonitoredServiceTests private void VerifyMonitored(Func predicate) { Mocker.GetMock() - .Verify(v => v.UpdateAlbums(It.Is>(l => l.Where(predicate).All(e => e.Monitored)))); + .Verify(v => v.UpdateMany(It.Is>(l => l.Where(predicate).All(e => e.Monitored)))); } private void VerifyNotMonitored(Func predicate) { Mocker.GetMock() - .Verify(v => v.UpdateAlbums(It.Is>(l => l.Where(predicate).All(e => !e.Monitored)))); + .Verify(v => v.UpdateMany(It.Is>(l => l.Where(predicate).All(e => !e.Monitored)))); } } } diff --git a/src/NzbDrone.Core/Music/AlbumMonitoredService.cs b/src/NzbDrone.Core/Music/AlbumMonitoredService.cs index 44090dc73..c9c6756f9 100644 --- a/src/NzbDrone.Core/Music/AlbumMonitoredService.cs +++ b/src/NzbDrone.Core/Music/AlbumMonitoredService.cs @@ -92,7 +92,7 @@ namespace NzbDrone.Core.Music } } - _albumService.UpdateAlbums(albums); + _albumService.UpdateMany(albums); } _artistService.UpdateArtist(artist); diff --git a/src/NzbDrone.Core/Music/AlbumService.cs b/src/NzbDrone.Core/Music/AlbumService.cs index d8c096244..903bd9b57 100644 --- a/src/NzbDrone.Core/Music/AlbumService.cs +++ b/src/NzbDrone.Core/Music/AlbumService.cs @@ -25,7 +25,6 @@ namespace NzbDrone.Core.Music void DeleteAlbum(int albumId, bool deleteFiles); List GetAllAlbums(); Album UpdateAlbum(Album album); - List UpdateAlbums(List album); void SetAlbumMonitored(int albumId, bool monitored); void SetMonitored(IEnumerable ids, bool monitored); PagingSpec AlbumsWithoutFiles(PagingSpec pagingSpec); @@ -280,16 +279,6 @@ namespace NzbDrone.Core.Music } } - public List UpdateAlbums(List 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);