diff --git a/lib/native/mac-x86_64/fpcalc b/lib/native/mac-x86_64/fpcalc index b580ad6e..5927546e 100644 Binary files a/lib/native/mac-x86_64/fpcalc and b/lib/native/mac-x86_64/fpcalc differ diff --git a/lib/native/win32-x86/fpcalc.exe b/lib/native/win32-x86/fpcalc.exe index 7b337f2f..8c5da922 100644 Binary files a/lib/native/win32-x86/fpcalc.exe and b/lib/native/win32-x86/fpcalc.exe differ diff --git a/source/net/sourceforge/filebot/ui/rename/AudioFingerprintMatcher.java b/source/net/sourceforge/filebot/ui/rename/AudioFingerprintMatcher.java index 71c553b0..05c0abb1 100644 --- a/source/net/sourceforge/filebot/ui/rename/AudioFingerprintMatcher.java +++ b/source/net/sourceforge/filebot/ui/rename/AudioFingerprintMatcher.java @@ -1,7 +1,5 @@ - package net.sourceforge.filebot.ui.rename; - import static net.sourceforge.filebot.MediaTypes.*; import static net.sourceforge.tuned.FileUtilities.*; @@ -20,46 +18,45 @@ import net.sourceforge.filebot.web.ID3Lookup; import net.sourceforge.filebot.web.MusicIdentificationService; import net.sourceforge.filebot.web.SortOrder; - class AudioFingerprintMatcher implements AutoCompleteMatcher { - + private MusicIdentificationService service; - - + public AudioFingerprintMatcher(MusicIdentificationService service) { this.service = service; } - - + @Override public List> match(List files, SortOrder order, Locale locale, boolean autodetection, Component parent) throws Exception { List> matches = new ArrayList>(); - List audioFiles = filter(files, AUDIO_FILES); - + List audioFiles = filter(files, AUDIO_FILES, VIDEO_FILES); + // check audio files against acoustid - for (Entry it : service.lookup(audioFiles).entrySet()) { - if (it.getKey().exists() && it.getValue() != null) { - AudioTrack track = it.getValue().clone(); - - // use AcoustID as default but prefer with ID3 data if available - if (!autodetection) { - AudioTrack id3 = new ID3Lookup().lookup(Collections.singleton(it.getKey())).get(it.getKey()); - for (Field field : AudioTrack.class.getDeclaredFields()) { - if (!field.isAccessible()) { - field.setAccessible(true); - } - Object id3value = field.get(id3); - if (id3value != null && !id3value.toString().isEmpty()) { - field.set(track, id3value); + if (audioFiles.size() > 0) { + for (Entry it : service.lookup(audioFiles).entrySet()) { + if (it.getKey().exists() && it.getValue() != null) { + AudioTrack track = it.getValue().clone(); + + // use AcoustID as default but prefer with ID3 data if available + if (!autodetection) { + AudioTrack id3 = new ID3Lookup().lookup(Collections.singleton(it.getKey())).get(it.getKey()); + for (Field field : AudioTrack.class.getDeclaredFields()) { + if (!field.isAccessible()) { + field.setAccessible(true); + } + Object id3value = field.get(id3); + if (id3value != null && !id3value.toString().isEmpty()) { + field.set(track, id3value); + } } } + + matches.add(new Match(it.getKey(), track)); } - - matches.add(new Match(it.getKey(), track)); } } - + return matches; } - + }