Improve error handling for jaudiotaggerParser artwork fetch

master
Evan Harris 5 years ago
parent 6f57c6e313
commit 83ca97e21c
No known key found for this signature in database
GPG Key ID: FF3BD4DA59FF9EDC
  1. 4
      airsonic-main/src/main/java/org/airsonic/player/controller/CoverArtController.java

@ -292,12 +292,12 @@ public class CoverArtController implements LastModified {
try {
LOG.trace("Reading artwork from file {}", mediaFile);
artwork = jaudiotaggerParser.getArtwork(mediaFile);
is = new ByteArrayInputStream(artwork.getBinaryData());
mimeType = artwork.getMimeType();
} catch (Exception e) {
LOG.debug("Could not read artwork from file {}", mediaFile);
throw new RuntimeException(e);
}
is = new ByteArrayInputStream(artwork.getBinaryData());
mimeType = artwork.getMimeType();
} else {
is = new FileInputStream(file);
mimeType = StringUtil.getMimeType(FilenameUtils.getExtension(file.getName()));

Loading…
Cancel
Save