diff --git a/src/AudioTagger.Console/Operations/TagArtworkExtractor.cs b/src/AudioTagger.Console/Operations/TagArtworkExtractor.cs index 3bb8ca9..2a0bf19 100644 --- a/src/AudioTagger.Console/Operations/TagArtworkExtractor.cs +++ b/src/AudioTagger.Console/Operations/TagArtworkExtractor.cs @@ -82,6 +82,7 @@ private static void ProcessDirectory(FilesGroupedByDir fileGroup, IPrinter print { printer.Warning("More than one image is most populous, but only one will be extracted."); } + var filesWithChosenMostCommonArt = filesWithMostCommonArt.First(); ExtractArtwork(filesWithChosenMostCommonArt, printer); @@ -92,13 +93,9 @@ private static void ProcessDirectory(FilesGroupedByDir fileGroup, IPrinter print } } - private static void ExtractArtwork( - FilesGroupedByCount filesWithChosenMostCommonArt, - IPrinter printer) + private static void ExtractArtwork(FilesGroupedByCount fileGroup, IPrinter printer) { - int failures = 0; - - MediaFile artSourceFile = filesWithChosenMostCommonArt.First(); + MediaFile artSourceFile = fileGroup.First(); string directoryName = artSourceFile.FileInfo.DirectoryName!; var extractResult = artSourceFile.ExtractArtworkToFile(directoryName, _artworkFileName); @@ -108,16 +105,8 @@ private static void ExtractArtwork( } else { - failures++; printer.FirstError(extractResult, "Artwork extraction error:"); } - - if (failures != 0) - { - var errorLabel = failures == 1 ? "error" : "errors"; - printer.Warning($"There were {failures} extraction {errorLabel}, so will not delete any artwork."); - return; - } } private static void RemoveArtworkAndRewriteTags(MediaFile file, IPrinter printer)