* try {media.Composer} as fallback if {media.Performer} is not set
@see https://www.filebot.net/forums/viewtopic.php?f=4&t=3061#p17550
This commit is contained in:
parent
35608f6789
commit
d6569765be
|
@ -38,7 +38,7 @@ public class ID3Lookup implements MusicIdentificationService {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// artist and song title information is required
|
// artist and song title information is required
|
||||||
String artist = getString(mediaInfo, "Performer");
|
String artist = getString(mediaInfo, "Performer", "Composer");
|
||||||
String title = getString(mediaInfo, "Title");
|
String title = getString(mediaInfo, "Title");
|
||||||
|
|
||||||
if (artist != null && title != null) {
|
if (artist != null && title != null) {
|
||||||
|
@ -70,10 +70,12 @@ public class ID3Lookup implements MusicIdentificationService {
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getString(MediaInfo mediaInfo, String field) {
|
private String getString(MediaInfo mediaInfo, String... keys) {
|
||||||
String value = mediaInfo.get(StreamKind.General, 0, field).trim();
|
for (String key : keys) {
|
||||||
if (value.length() > 0) {
|
String value = mediaInfo.get(StreamKind.General, 0, key);
|
||||||
return value;
|
if (value.length() > 0) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue