* remove Sublight/Subscene related visible components
This commit is contained in:
parent
c2d6e157c6
commit
4c07edb65b
|
@ -33,8 +33,6 @@ import net.sourceforge.filebot.web.MusicIdentificationService;
|
|||
import net.sourceforge.filebot.web.OpenSubtitlesClient;
|
||||
import net.sourceforge.filebot.web.SearchResult;
|
||||
import net.sourceforge.filebot.web.SerienjunkiesClient;
|
||||
import net.sourceforge.filebot.web.SublightSubtitleClient;
|
||||
import net.sourceforge.filebot.web.SubsceneSubtitleClient;
|
||||
import net.sourceforge.filebot.web.SubtitleProvider;
|
||||
import net.sourceforge.filebot.web.TMDbClient;
|
||||
import net.sourceforge.filebot.web.TVRageClient;
|
||||
|
@ -61,8 +59,7 @@ public final class WebServices {
|
|||
|
||||
// subtitle dbs
|
||||
public static final OpenSubtitlesClient OpenSubtitles = new OpenSubtitlesClient(String.format("%s %s", getApplicationName(), getApplicationVersion()));
|
||||
public static final SubsceneSubtitleClient Subscene = new SubsceneSubtitleClient();
|
||||
public static final SublightSubtitleClient Sublight = new SublightSubtitleClient();
|
||||
//TODO remove Subscene/Sublight from codebase
|
||||
|
||||
// misc
|
||||
public static final FanartTV FanartTV = new FanartTV(Settings.getApplicationProperty("fanart.tv.apikey"));
|
||||
|
@ -238,12 +235,6 @@ public final class WebServices {
|
|||
static {
|
||||
String[] osdbLogin = getLogin("osdb.user");
|
||||
OpenSubtitles.setUser(osdbLogin[0], osdbLogin[1]);
|
||||
|
||||
String[] sublightClientLogin = getLogin("sublight.client");
|
||||
Sublight.setClient(sublightClientLogin[0], sublightClientLogin[1]);
|
||||
|
||||
String[] sublightUserLogin = getLogin("sublight.user");
|
||||
Sublight.setUser(sublightUserLogin[0], sublightUserLogin[1]);
|
||||
}
|
||||
|
||||
|
||||
|
@ -263,12 +254,6 @@ public final class WebServices {
|
|||
if (id.equals("osdb.user")) {
|
||||
settings.put(id, value);
|
||||
OpenSubtitles.setUser(user, password);
|
||||
} else if (id.equals("sublight.user")) {
|
||||
settings.put(id, value);
|
||||
Sublight.setUser(user, password);
|
||||
} else if (id.equals("sublight.client")) {
|
||||
settings.put(id, value);
|
||||
Sublight.setClient(user, password);
|
||||
} else {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
|
|
@ -43,7 +43,6 @@ import net.sourceforge.filebot.ui.LanguageComboBox;
|
|||
import net.sourceforge.filebot.ui.SelectDialog;
|
||||
import net.sourceforge.filebot.web.OpenSubtitlesClient;
|
||||
import net.sourceforge.filebot.web.SearchResult;
|
||||
import net.sourceforge.filebot.web.SublightSubtitleClient;
|
||||
import net.sourceforge.filebot.web.SubtitleDescriptor;
|
||||
import net.sourceforge.filebot.web.SubtitleProvider;
|
||||
import net.sourceforge.filebot.web.VideoHashSubtitleService;
|
||||
|
@ -250,22 +249,11 @@ public class SubtitlePanel extends AbstractSearchPanel<SubtitleProvider, Subtitl
|
|||
final JPasswordField osdbPass = new JPasswordField(12);
|
||||
osdbGroup.add(osdbPass, "growx, wrap rel");
|
||||
|
||||
JPanel sublGroup = new JPanel(new MigLayout("fill, insets panel"));
|
||||
sublGroup.setBorder(new TitledBorder("Sublight"));
|
||||
sublGroup.add(new JLabel("Username:"), "gap rel");
|
||||
final JTextField sublUser = new JTextField(12);
|
||||
sublGroup.add(sublUser, "growx, wrap rel");
|
||||
|
||||
sublGroup.add(new JLabel("Password:"), "gap rel");
|
||||
final JPasswordField sublPass = new JPasswordField(12);
|
||||
sublGroup.add(sublPass, "growx, wrap rel");
|
||||
|
||||
JRootPane container = authPanel.getRootPane();
|
||||
container.setLayout(new MigLayout("fill, insets dialog"));
|
||||
container.removeAll();
|
||||
|
||||
container.add(osdbGroup, "growx, wrap");
|
||||
container.add(sublGroup, "growx, wrap");
|
||||
|
||||
Action ok = new AbstractAction("OK") {
|
||||
|
||||
|
@ -284,22 +272,10 @@ public class SubtitlePanel extends AbstractSearchPanel<SubtitleProvider, Subtitl
|
|||
UILogger.log(Level.WARNING, "OpenSubtitles: " + e.getMessage());
|
||||
approved = false;
|
||||
}
|
||||
try {
|
||||
if (sublUser.getText().length() > 0 && sublPass.getPassword().length > 0) {
|
||||
SublightSubtitleClient sublight = new SublightSubtitleClient();
|
||||
sublight.setClient(getApplicationProperty("sublight.clientid"), getApplicationProperty("sublight.apikey"));
|
||||
sublight.setUser(sublUser.getText(), new String(sublPass.getPassword()));
|
||||
sublight.login();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
UILogger.log(Level.WARNING, "Sublight: " + e.getMessage());
|
||||
approved = false;
|
||||
}
|
||||
|
||||
authPanel.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
|
||||
if (approved) {
|
||||
WebServices.setLogin("osdb.user", osdbUser.getText(), new String(osdbPass.getPassword()));
|
||||
WebServices.setLogin("sublight.user", sublUser.getText(), new String(sublPass.getPassword()));
|
||||
WebServices.setLogin("sublight.client", getApplicationProperty("sublight.clientid"), getApplicationProperty("sublight.apikey"));
|
||||
authPanel.setVisible(false);
|
||||
}
|
||||
}
|
||||
|
@ -318,9 +294,6 @@ public class SubtitlePanel extends AbstractSearchPanel<SubtitleProvider, Subtitl
|
|||
String[] osdbAuth = WebServices.getLogin("osdb.user");
|
||||
osdbUser.setText(osdbAuth[0]);
|
||||
osdbPass.setText(osdbAuth[1]);
|
||||
String[] sublAuth = WebServices.getLogin("sublight.user");
|
||||
sublUser.setText(sublAuth[0]);
|
||||
sublPass.setText(sublAuth[1]);
|
||||
|
||||
authPanel.pack();
|
||||
authPanel.setVisible(true);
|
||||
|
|
|
@ -4,21 +4,8 @@ def osdbUser = console.readLine()
|
|||
console.print('Enter OpenSubtitles password: ')
|
||||
def osdbPwd = console.readLine()
|
||||
|
||||
// Sublight
|
||||
console.print('Enter Sublight username: ')
|
||||
def sublightUser = console.readLine()
|
||||
console.print('Enter Sublight password: ')
|
||||
def sublightPwd = console.readLine()
|
||||
|
||||
// I've requested a new API key for FileBot multiple times and have yet to recieve a reply...
|
||||
// @from http://sublightcmd.codeplex.com/SourceControl/changeset/view/9437#8043
|
||||
def sublightClientId = 'SublightCmd'
|
||||
def sublightApiKey = '12c72276-b95f-4144-bb2a-879775c71437'
|
||||
|
||||
|
||||
setLogin('osdb.user', osdbUser, osdbPwd)
|
||||
setLogin('sublight.client', sublightClientId, sublightApiKey)
|
||||
setLogin('sublight.user', sublightUser, sublightPwd)
|
||||
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
@ -32,14 +19,6 @@ if (osdbUser) {
|
|||
console.println('OK')
|
||||
}
|
||||
|
||||
if (sublightUser) {
|
||||
console.print('Testing Sublight... ')
|
||||
WebServices.Sublight.setClient(sublightClientId, sublightApiKey)
|
||||
WebServices.Sublight.setUser(sublightUser, sublightPwd)
|
||||
WebServices.Sublight.getSubtitleList(null, 'Avatar', 2009, 'English')
|
||||
console.println('OK')
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
def setLogin(key, user, pwd) {
|
||||
|
|
Loading…
Reference in New Issue