Refactor
This commit is contained in:
parent
e48ecf4fa2
commit
f0252c42cd
|
@ -51,11 +51,11 @@ import net.filebot.web.MovieIdentificationService;
|
|||
import net.filebot.web.MoviePart;
|
||||
import net.filebot.web.SortOrder;
|
||||
|
||||
class MovieHashMatcher implements AutoCompleteMatcher {
|
||||
class MovieMatcher implements AutoCompleteMatcher {
|
||||
|
||||
private final MovieIdentificationService service;
|
||||
|
||||
public MovieHashMatcher(MovieIdentificationService service) {
|
||||
public MovieMatcher(MovieIdentificationService service) {
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
|
@ -394,7 +394,7 @@ class MovieHashMatcher implements AutoCompleteMatcher {
|
|||
selectDialog.getCancelAction().putValue(Action.NAME, "Ignore");
|
||||
|
||||
// restore original dialog size
|
||||
Settings prefs = Settings.forPackage(MovieHashMatcher.class);
|
||||
Settings prefs = Settings.forPackage(MovieMatcher.class);
|
||||
int w = Integer.parseInt(prefs.get("dialog.select.w", "280"));
|
||||
int h = Integer.parseInt(prefs.get("dialog.select.h", "300"));
|
||||
selectDialog.setPreferredSize(new Dimension(w, h));
|
|
@ -16,11 +16,11 @@ import net.filebot.web.AudioTrack;
|
|||
import net.filebot.web.MusicIdentificationService;
|
||||
import net.filebot.web.SortOrder;
|
||||
|
||||
class AudioFingerprintMatcher implements AutoCompleteMatcher {
|
||||
class MusicMatcher implements AutoCompleteMatcher {
|
||||
|
||||
private MusicIdentificationService[] services;
|
||||
|
||||
public AudioFingerprintMatcher(MusicIdentificationService... services) {
|
||||
public MusicMatcher(MusicIdentificationService... services) {
|
||||
this.services = services;
|
||||
}
|
||||
|
|
@ -94,7 +94,7 @@ public class Preset {
|
|||
public AutoCompleteMatcher getAutoCompleteMatcher() {
|
||||
MovieIdentificationService mdb = WebServices.getMovieIdentificationService(database);
|
||||
if (mdb != null) {
|
||||
return new MovieHashMatcher(mdb);
|
||||
return new MovieMatcher(mdb);
|
||||
}
|
||||
|
||||
EpisodeListProvider sdb = WebServices.getEpisodeListProvider(database);
|
||||
|
@ -104,7 +104,7 @@ public class Preset {
|
|||
|
||||
MusicIdentificationService adb = WebServices.getMusicIdentificationService(database);
|
||||
if (adb != null) {
|
||||
return new AudioFingerprintMatcher(adb);
|
||||
return new MusicMatcher(adb);
|
||||
}
|
||||
|
||||
if (PlainFileMatcher.getInstance().getIdentifier().equals(database)) {
|
||||
|
|
|
@ -440,13 +440,13 @@ public class RenamePanel extends JComponent {
|
|||
|
||||
// create action for movie name completion
|
||||
for (MovieIdentificationService it : WebServices.getMovieIdentificationServices()) {
|
||||
actionPopup.add(new AutoCompleteAction(it.getName(), it.getIcon(), new MovieHashMatcher(it)));
|
||||
actionPopup.add(new AutoCompleteAction(it.getName(), it.getIcon(), new MovieMatcher(it)));
|
||||
}
|
||||
|
||||
actionPopup.addSeparator();
|
||||
actionPopup.addDescription(new JLabel("Music Mode:"));
|
||||
for (MusicIdentificationService it : WebServices.getMusicIdentificationServices()) {
|
||||
actionPopup.add(new AutoCompleteAction(it.getName(), it.getIcon(), new AudioFingerprintMatcher(it)));
|
||||
actionPopup.add(new AutoCompleteAction(it.getName(), it.getIcon(), new MusicMatcher(it)));
|
||||
}
|
||||
|
||||
actionPopup.addSeparator();
|
||||
|
|
Loading…
Reference in New Issue