forked from j62/ctbrec
Merge branch 'dev' into notify
This commit is contained in:
commit
9f19b2c1fa
|
@ -8,6 +8,7 @@ import ctbrec.ui.sites.AbstractConfigUI;
|
||||||
import javafx.geometry.Insets;
|
import javafx.geometry.Insets;
|
||||||
import javafx.scene.Parent;
|
import javafx.scene.Parent;
|
||||||
import javafx.scene.control.Button;
|
import javafx.scene.control.Button;
|
||||||
|
import javafx.scene.control.CheckBox;
|
||||||
import javafx.scene.control.Label;
|
import javafx.scene.control.Label;
|
||||||
import javafx.scene.control.PasswordField;
|
import javafx.scene.control.PasswordField;
|
||||||
import javafx.scene.control.TextField;
|
import javafx.scene.control.TextField;
|
||||||
|
@ -23,8 +24,9 @@ public class MyFreeCamsConfigUI extends AbstractConfigUI {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Parent createConfigPanel() {
|
public Parent createConfigPanel() {
|
||||||
|
int row = 0;
|
||||||
GridPane layout = SettingsTab.createGridLayout();
|
GridPane layout = SettingsTab.createGridLayout();
|
||||||
layout.add(new Label("MyFreeCams User"), 0, 0);
|
layout.add(new Label("MyFreeCams User"), 0, row);
|
||||||
TextField username = new TextField(Config.getInstance().getSettings().mfcUsername);
|
TextField username = new TextField(Config.getInstance().getSettings().mfcUsername);
|
||||||
username.setPrefWidth(300);
|
username.setPrefWidth(300);
|
||||||
username.textProperty().addListener((ob, o, n) -> {
|
username.textProperty().addListener((ob, o, n) -> {
|
||||||
|
@ -34,9 +36,9 @@ public class MyFreeCamsConfigUI extends AbstractConfigUI {
|
||||||
GridPane.setFillWidth(username, true);
|
GridPane.setFillWidth(username, true);
|
||||||
GridPane.setHgrow(username, Priority.ALWAYS);
|
GridPane.setHgrow(username, Priority.ALWAYS);
|
||||||
GridPane.setColumnSpan(username, 2);
|
GridPane.setColumnSpan(username, 2);
|
||||||
layout.add(username, 1, 0);
|
layout.add(username, 1, row++);
|
||||||
|
|
||||||
layout.add(new Label("MyFreeCams Password"), 0, 1);
|
layout.add(new Label("MyFreeCams Password"), 0, row);
|
||||||
PasswordField password = new PasswordField();
|
PasswordField password = new PasswordField();
|
||||||
password.setText(Config.getInstance().getSettings().mfcPassword);
|
password.setText(Config.getInstance().getSettings().mfcPassword);
|
||||||
password.textProperty().addListener((ob, o, n) -> {
|
password.textProperty().addListener((ob, o, n) -> {
|
||||||
|
@ -46,9 +48,9 @@ public class MyFreeCamsConfigUI extends AbstractConfigUI {
|
||||||
GridPane.setFillWidth(password, true);
|
GridPane.setFillWidth(password, true);
|
||||||
GridPane.setHgrow(password, Priority.ALWAYS);
|
GridPane.setHgrow(password, Priority.ALWAYS);
|
||||||
GridPane.setColumnSpan(password, 2);
|
GridPane.setColumnSpan(password, 2);
|
||||||
layout.add(password, 1, 1);
|
layout.add(password, 1, row++);
|
||||||
|
|
||||||
layout.add(new Label("MyFreeCams Base URL"), 0, 2);
|
layout.add(new Label("MyFreeCams Base URL"), 0, row);
|
||||||
TextField baseUrl = new TextField();
|
TextField baseUrl = new TextField();
|
||||||
baseUrl.setText(Config.getInstance().getSettings().mfcBaseUrl);
|
baseUrl.setText(Config.getInstance().getSettings().mfcBaseUrl);
|
||||||
baseUrl.textProperty().addListener((ob, o, n) -> {
|
baseUrl.textProperty().addListener((ob, o, n) -> {
|
||||||
|
@ -58,15 +60,24 @@ public class MyFreeCamsConfigUI extends AbstractConfigUI {
|
||||||
GridPane.setFillWidth(baseUrl, true);
|
GridPane.setFillWidth(baseUrl, true);
|
||||||
GridPane.setHgrow(baseUrl, Priority.ALWAYS);
|
GridPane.setHgrow(baseUrl, Priority.ALWAYS);
|
||||||
GridPane.setColumnSpan(baseUrl, 2);
|
GridPane.setColumnSpan(baseUrl, 2);
|
||||||
layout.add(baseUrl, 1, 2);
|
layout.add(baseUrl, 1, row++);
|
||||||
|
|
||||||
|
layout.add(new Label("Ignore upscaled stream (960p)"), 0, row);
|
||||||
|
CheckBox ignoreUpscaled = new CheckBox();
|
||||||
|
ignoreUpscaled.setSelected(Config.getInstance().getSettings().mfcIgnoreUpscaled);
|
||||||
|
ignoreUpscaled.selectedProperty().addListener((obs, oldV, newV) -> {
|
||||||
|
Config.getInstance().getSettings().mfcIgnoreUpscaled = newV;
|
||||||
|
});
|
||||||
|
layout.add(ignoreUpscaled, 1, row++);
|
||||||
|
|
||||||
Button createAccount = new Button("Create new Account");
|
Button createAccount = new Button("Create new Account");
|
||||||
createAccount.setOnAction((e) -> DesktopIntegration.open(myFreeCams.getAffiliateLink()));
|
createAccount.setOnAction((e) -> DesktopIntegration.open(myFreeCams.getAffiliateLink()));
|
||||||
layout.add(createAccount, 1, 3);
|
layout.add(createAccount, 1, row);
|
||||||
GridPane.setColumnSpan(createAccount, 2);
|
GridPane.setColumnSpan(createAccount, 2);
|
||||||
GridPane.setMargin(username, new Insets(0, 0, 0, SettingsTab.CHECKBOX_MARGIN));
|
GridPane.setMargin(username, new Insets(0, 0, 0, SettingsTab.CHECKBOX_MARGIN));
|
||||||
GridPane.setMargin(password, new Insets(0, 0, 0, SettingsTab.CHECKBOX_MARGIN));
|
GridPane.setMargin(password, new Insets(0, 0, 0, SettingsTab.CHECKBOX_MARGIN));
|
||||||
GridPane.setMargin(baseUrl, new Insets(0, 0, 0, SettingsTab.CHECKBOX_MARGIN));
|
GridPane.setMargin(baseUrl, new Insets(0, 0, 0, SettingsTab.CHECKBOX_MARGIN));
|
||||||
|
GridPane.setMargin(ignoreUpscaled, new Insets(0, 0, 0, SettingsTab.CHECKBOX_MARGIN));
|
||||||
GridPane.setMargin(createAccount, new Insets(0, 0, 0, SettingsTab.CHECKBOX_MARGIN));
|
GridPane.setMargin(createAccount, new Insets(0, 0, 0, SettingsTab.CHECKBOX_MARGIN));
|
||||||
|
|
||||||
return layout;
|
return layout;
|
||||||
|
|
|
@ -49,6 +49,7 @@ public class Settings {
|
||||||
public String mfcUsername = "";
|
public String mfcUsername = "";
|
||||||
public String mfcPassword = "";
|
public String mfcPassword = "";
|
||||||
public String mfcBaseUrl = "https://www.myfreecams.com";
|
public String mfcBaseUrl = "https://www.myfreecams.com";
|
||||||
|
public boolean mfcIgnoreUpscaled = false;
|
||||||
public String camsodaUsername = "";
|
public String camsodaUsername = "";
|
||||||
public String camsodaPassword = "";
|
public String camsodaPassword = "";
|
||||||
public String cam4Username;
|
public String cam4Username;
|
||||||
|
|
|
@ -10,6 +10,7 @@ import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.jsoup.nodes.Element;
|
import org.jsoup.nodes.Element;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
@ -28,6 +29,7 @@ import com.squareup.moshi.JsonReader;
|
||||||
import com.squareup.moshi.JsonWriter;
|
import com.squareup.moshi.JsonWriter;
|
||||||
|
|
||||||
import ctbrec.AbstractModel;
|
import ctbrec.AbstractModel;
|
||||||
|
import ctbrec.Config;
|
||||||
import ctbrec.io.HtmlParser;
|
import ctbrec.io.HtmlParser;
|
||||||
import ctbrec.io.HttpException;
|
import ctbrec.io.HttpException;
|
||||||
import ctbrec.recorder.download.StreamSource;
|
import ctbrec.recorder.download.StreamSource;
|
||||||
|
@ -111,7 +113,13 @@ public class MyFreeCamsModel extends AbstractModel {
|
||||||
sources.add(src);
|
sources.add(src);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return sources;
|
if(Config.getInstance().getSettings().mfcIgnoreUpscaled) {
|
||||||
|
return sources.stream()
|
||||||
|
.filter(src -> src.height != 960)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
} else {
|
||||||
|
return sources;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private MasterPlaylist getMasterPlaylist() throws IOException, ParseException, PlaylistException {
|
private MasterPlaylist getMasterPlaylist() throws IOException, ParseException, PlaylistException {
|
||||||
|
|
Loading…
Reference in New Issue