mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
New: Make sure existing items on import list are monitored
This commit is contained in:
parent
2ca6a8da84
commit
d85d2bb371
1 changed files with 43 additions and 15 deletions
|
@ -161,30 +161,51 @@ namespace NzbDrone.Core.ImportLists
|
||||||
// Check to see if album in DB
|
// Check to see if album in DB
|
||||||
var existingAlbum = _albumService.FindById(report.AlbumMusicBrainzId);
|
var existingAlbum = _albumService.FindById(report.AlbumMusicBrainzId);
|
||||||
|
|
||||||
if (existingAlbum != null)
|
|
||||||
{
|
|
||||||
_logger.Debug("{0} [{1}] Rejected, Album Exists in DB", report.AlbumMusicBrainzId, report.Album);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check to see if album excluded
|
// Check to see if album excluded
|
||||||
var excludedAlbum = listExclusions.SingleOrDefault(s => s.ForeignId == report.AlbumMusicBrainzId);
|
var excludedAlbum = listExclusions.SingleOrDefault(s => s.ForeignId == report.AlbumMusicBrainzId);
|
||||||
|
|
||||||
|
// Check to see if artist excluded
|
||||||
|
var excludedArtist = listExclusions.SingleOrDefault(s => s.ForeignId == report.ArtistMusicBrainzId);
|
||||||
|
|
||||||
if (excludedAlbum != null)
|
if (excludedAlbum != null)
|
||||||
{
|
{
|
||||||
_logger.Debug("{0} [{1}] Rejected due to list exlcusion", report.AlbumMusicBrainzId, report.Album);
|
_logger.Debug("{0} [{1}] Rejected due to list exlcusion", report.AlbumMusicBrainzId, report.Album);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check to see if artist excluded
|
|
||||||
var excludedArtist = listExclusions.SingleOrDefault(s => s.ForeignId == report.ArtistMusicBrainzId);
|
|
||||||
|
|
||||||
if (excludedArtist != null)
|
if (excludedArtist != null)
|
||||||
{
|
{
|
||||||
_logger.Debug("{0} [{1}] Rejected due to list exlcusion for parent artist", report.AlbumMusicBrainzId, report.Album);
|
_logger.Debug("{0} [{1}] Rejected due to list exlcusion for parent artist", report.AlbumMusicBrainzId, report.Album);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (existingAlbum != null)
|
||||||
|
{
|
||||||
|
_logger.Debug("{0} [{1}] Rejected, Album Exists in DB. Ensuring Album and Artist monitored.", report.AlbumMusicBrainzId, report.Album);
|
||||||
|
|
||||||
|
if (importList.ShouldMonitor != ImportListMonitorType.None)
|
||||||
|
{
|
||||||
|
if (!existingAlbum.Monitored)
|
||||||
|
{
|
||||||
|
_albumService.SetAlbumMonitored(existingAlbum.Id, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
var existingArtist = existingAlbum.Artist.Value;
|
||||||
|
if (importList.ShouldMonitor == ImportListMonitorType.EntireArtist)
|
||||||
|
{
|
||||||
|
_albumService.SetMonitored(existingArtist.Albums.Value.Select(x => x.Id), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!existingArtist.Monitored)
|
||||||
|
{
|
||||||
|
existingArtist.Monitored = true;
|
||||||
|
_artistService.UpdateArtist(existingArtist);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Append Album if not already in DB or already on add list
|
// Append Album if not already in DB or already on add list
|
||||||
if (albumsToAdd.All(s => s.ForeignAlbumId != report.AlbumMusicBrainzId))
|
if (albumsToAdd.All(s => s.ForeignAlbumId != report.AlbumMusicBrainzId))
|
||||||
{
|
{
|
||||||
|
@ -242,12 +263,6 @@ namespace NzbDrone.Core.ImportLists
|
||||||
// Check to see if artist in DB
|
// Check to see if artist in DB
|
||||||
var existingArtist = _artistService.FindById(report.ArtistMusicBrainzId);
|
var existingArtist = _artistService.FindById(report.ArtistMusicBrainzId);
|
||||||
|
|
||||||
if (existingArtist != null)
|
|
||||||
{
|
|
||||||
_logger.Debug("{0} [{1}] Rejected, Artist Exists in DB", report.ArtistMusicBrainzId, report.Artist);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check to see if artist excluded
|
// Check to see if artist excluded
|
||||||
var excludedArtist = listExclusions.Where(s => s.ForeignId == report.ArtistMusicBrainzId).SingleOrDefault();
|
var excludedArtist = listExclusions.Where(s => s.ForeignId == report.ArtistMusicBrainzId).SingleOrDefault();
|
||||||
|
|
||||||
|
@ -257,6 +272,19 @@ namespace NzbDrone.Core.ImportLists
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (existingArtist != null)
|
||||||
|
{
|
||||||
|
_logger.Debug("{0} [{1}] Rejected, Author Exists in DB. Ensuring Author monitored", report.ArtistMusicBrainzId, report.Artist);
|
||||||
|
|
||||||
|
if (!existingArtist.Monitored)
|
||||||
|
{
|
||||||
|
existingArtist.Monitored = true;
|
||||||
|
_artistService.UpdateArtist(existingArtist);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Append Artist if not already in DB or already on add list
|
// Append Artist if not already in DB or already on add list
|
||||||
if (artistsToAdd.All(s => s.Metadata.Value.ForeignArtistId != report.ArtistMusicBrainzId))
|
if (artistsToAdd.All(s => s.Metadata.Value.ForeignArtistId != report.ArtistMusicBrainzId))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue