Fix processing when artist and albumArtist are null

master
tesshucom 6 years ago
parent f5f1ec336f
commit 133cf666b7
  1. 10
      airsonic-main/src/main/java/org/airsonic/player/service/metadata/JaudiotaggerParser.java

@ -97,8 +97,8 @@ public class JaudiotaggerParser extends MetaDataParser {
metaData.setTrackNumber(parseTrackNumber(getTagField(tag, FieldKey.TRACK)));
metaData.setMusicBrainzReleaseId(getTagField(tag, FieldKey.MUSICBRAINZ_RELEASEID));
String songArtist = getTagField(tag, FieldKey.ARTIST);
String albumArtist = getTagField(tag, FieldKey.ALBUM_ARTIST);
metaData.setArtist(getTagField(tag, FieldKey.ARTIST));
metaData.setAlbumArtist(getTagField(tag, FieldKey.ALBUM_ARTIST));
if (tag instanceof AbstractID3Tag && 0 < audioFile.getTag().getFieldCount()) {
@ -140,7 +140,7 @@ public class JaudiotaggerParser extends MetaDataParser {
}
break;
case ID3v24Frames.FRAME_ID_ARTIST:
if (null == metaData.getArtist() && null == songArtist) {
if (null == metaData.getArtist()) {
metaData.setArtist(f.toString());
}
break;
@ -156,10 +156,10 @@ public class JaudiotaggerParser extends MetaDataParser {
}
}
if (StringUtils.isBlank(metaData.getArtist())) {
metaData.setArtist(StringUtils.isBlank(songArtist) ? albumArtist : songArtist);
metaData.setArtist(metaData.getAlbumArtist());
}
if (StringUtils.isBlank(metaData.getAlbumArtist())) {
metaData.setAlbumArtist(StringUtils.isBlank(albumArtist) ? songArtist : albumArtist);
metaData.setAlbumArtist(metaData.getArtist());
}
}

Loading…
Cancel
Save