private void AttachCoverArt([CanBeNull] ReleaseMedium releaseMedium, AttachFileDelegate @delegate) { var coverArt = releaseMedium != null?releaseMedium.CoverArtImages.FirstOrDefault(image => image.IsSelected) : null; var coverArtImage = coverArt != null ? coverArt.Image : null; if (coverArtImage == null) { return; } AttachCoverArt(coverArtImage, @delegate); }
private void AttachCoverArt([CanBeNull] Image coverArt, AttachFileDelegate @delegate) { var coverImagePathLarge = ResizeCoverArt(coverArt, CoverArtSize.Large, "cover.jpg"); var coverImagePathSmall = ResizeCoverArt(coverArt, CoverArtSize.Small, "small_cover.jpg"); if (coverImagePathLarge != null) { @delegate(coverImagePathLarge); } if (coverImagePathSmall != null) { @delegate(coverImagePathSmall); } }