public bool RefreshAlbumInfo(List <Album> albums, List <Album> remoteAlbums, bool forceAlbumRefresh, bool forceUpdateFileTags, DateTime?lastUpdate) { bool updated = false; HashSet <string> updatedMusicbrainzAlbums = null; if (lastUpdate.HasValue && lastUpdate.Value.AddDays(14) > DateTime.UtcNow) { updatedMusicbrainzAlbums = _albumInfo.GetChangedAlbums(lastUpdate.Value); } foreach (var album in albums) { if (forceAlbumRefresh || (updatedMusicbrainzAlbums == null && _checkIfAlbumShouldBeRefreshed.ShouldRefresh(album)) || (updatedMusicbrainzAlbums != null && updatedMusicbrainzAlbums.Contains(album.ForeignAlbumId))) { updated |= RefreshAlbumInfo(album, remoteAlbums, forceUpdateFileTags); } else { _logger.Debug("Skipping refresh of album: {0}", album.Title); } } return(updated); }
public bool RefreshAlbumInfo(List <Album> albums, List <Album> remoteAlbums, bool forceAlbumRefresh, bool forceUpdateFileTags) { bool updated = false; foreach (var album in albums) { if (forceAlbumRefresh || _checkIfAlbumShouldBeRefreshed.ShouldRefresh(album)) { updated |= RefreshAlbumInfo(album, remoteAlbums, forceUpdateFileTags); } } return(updated); }