From 425bfb83ea69a54586ae918a2133b3c7234a393e Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Wed, 13 Aug 2014 15:56:58 +0000 Subject: [PATCH] * remove useless code --- .../ui/rename/AudioFingerprintMatcher.java | 22 ++----------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/source/net/filebot/ui/rename/AudioFingerprintMatcher.java b/source/net/filebot/ui/rename/AudioFingerprintMatcher.java index 798c0977..71d70a9a 100644 --- a/source/net/filebot/ui/rename/AudioFingerprintMatcher.java +++ b/source/net/filebot/ui/rename/AudioFingerprintMatcher.java @@ -5,16 +5,13 @@ import static net.filebot.util.FileUtilities.*; import java.awt.Component; import java.io.File; -import java.lang.reflect.Field; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import java.util.Locale; import java.util.Map.Entry; import net.filebot.similarity.Match; import net.filebot.web.AudioTrack; -import net.filebot.web.ID3Lookup; import net.filebot.web.MusicIdentificationService; import net.filebot.web.SortOrder; @@ -27,30 +24,15 @@ class AudioFingerprintMatcher implements AutoCompleteMatcher { } @Override - public List> match(List files, SortOrder order, Locale locale, boolean autodetection, Component parent) throws Exception { + public List> match(List files, boolean strict, SortOrder order, Locale locale, boolean autodetection, Component parent) throws Exception { List> matches = new ArrayList>(); List audioFiles = filter(files, AUDIO_FILES, VIDEO_FILES); - // check audio files against acoustid + // check audio files against AcoustID 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)); } }