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.scene.Parent;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.CheckBox;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
|
@ -23,8 +24,9 @@ public class MyFreeCamsConfigUI extends AbstractConfigUI {
|
|||
|
||||
@Override
|
||||
public Parent createConfigPanel() {
|
||||
int row = 0;
|
||||
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);
|
||||
username.setPrefWidth(300);
|
||||
username.textProperty().addListener((ob, o, n) -> {
|
||||
|
@ -34,9 +36,9 @@ public class MyFreeCamsConfigUI extends AbstractConfigUI {
|
|||
GridPane.setFillWidth(username, true);
|
||||
GridPane.setHgrow(username, Priority.ALWAYS);
|
||||
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();
|
||||
password.setText(Config.getInstance().getSettings().mfcPassword);
|
||||
password.textProperty().addListener((ob, o, n) -> {
|
||||
|
@ -46,9 +48,9 @@ public class MyFreeCamsConfigUI extends AbstractConfigUI {
|
|||
GridPane.setFillWidth(password, true);
|
||||
GridPane.setHgrow(password, Priority.ALWAYS);
|
||||
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();
|
||||
baseUrl.setText(Config.getInstance().getSettings().mfcBaseUrl);
|
||||
baseUrl.textProperty().addListener((ob, o, n) -> {
|
||||
|
@ -58,15 +60,24 @@ public class MyFreeCamsConfigUI extends AbstractConfigUI {
|
|||
GridPane.setFillWidth(baseUrl, true);
|
||||
GridPane.setHgrow(baseUrl, Priority.ALWAYS);
|
||||
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");
|
||||
createAccount.setOnAction((e) -> DesktopIntegration.open(myFreeCams.getAffiliateLink()));
|
||||
layout.add(createAccount, 1, 3);
|
||||
layout.add(createAccount, 1, row);
|
||||
GridPane.setColumnSpan(createAccount, 2);
|
||||
GridPane.setMargin(username, 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(ignoreUpscaled, new Insets(0, 0, 0, SettingsTab.CHECKBOX_MARGIN));
|
||||
GridPane.setMargin(createAccount, new Insets(0, 0, 0, SettingsTab.CHECKBOX_MARGIN));
|
||||
|
||||
return layout;
|
||||
|
|
|
@ -49,6 +49,7 @@ public class Settings {
|
|||
public String mfcUsername = "";
|
||||
public String mfcPassword = "";
|
||||
public String mfcBaseUrl = "https://www.myfreecams.com";
|
||||
public boolean mfcIgnoreUpscaled = false;
|
||||
public String camsodaUsername = "";
|
||||
public String camsodaPassword = "";
|
||||
public String cam4Username;
|
||||
|
|
|
@ -10,6 +10,7 @@ import java.util.List;
|
|||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.jsoup.nodes.Element;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -28,6 +29,7 @@ import com.squareup.moshi.JsonReader;
|
|||
import com.squareup.moshi.JsonWriter;
|
||||
|
||||
import ctbrec.AbstractModel;
|
||||
import ctbrec.Config;
|
||||
import ctbrec.io.HtmlParser;
|
||||
import ctbrec.io.HttpException;
|
||||
import ctbrec.recorder.download.StreamSource;
|
||||
|
@ -111,7 +113,13 @@ public class MyFreeCamsModel extends AbstractModel {
|
|||
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 {
|
||||
|
|
Loading…
Reference in New Issue