test na only filter

This commit is contained in:
J62 2025-03-15 13:16:45 -07:00
parent daa192c42b
commit 3f4ae44bae
2 changed files with 49 additions and 34 deletions

View File

@ -70,6 +70,7 @@ public class SettingsTab extends Tab implements TabSelectionListener {
private SimpleBooleanProperty determineResolution; private SimpleBooleanProperty determineResolution;
private SimpleBooleanProperty chooseStreamQuality; private SimpleBooleanProperty chooseStreamQuality;
private SimpleBooleanProperty confirmationDialogs; private SimpleBooleanProperty confirmationDialogs;
private SimpleBooleanProperty naCamsOnly;
private SimpleBooleanProperty livePreviews; private SimpleBooleanProperty livePreviews;
private SimpleBooleanProperty monitorClipboard; private SimpleBooleanProperty monitorClipboard;
private SimpleListProperty<String> startTab; private SimpleListProperty<String> startTab;
@ -207,6 +208,8 @@ public class SettingsTab extends Tab implements TabSelectionListener {
onlineCheckSkipsPausedModels = new SimpleBooleanProperty(null, "onlineCheckSkipsPausedModels", settings.onlineCheckSkipsPausedModels); onlineCheckSkipsPausedModels = new SimpleBooleanProperty(null, "onlineCheckSkipsPausedModels", settings.onlineCheckSkipsPausedModels);
fastScrollSpeed = new SimpleBooleanProperty(null, "fastScrollSpeed", settings.fastScrollSpeed); fastScrollSpeed = new SimpleBooleanProperty(null, "fastScrollSpeed", settings.fastScrollSpeed);
confirmationDialogs = new SimpleBooleanProperty(null, "confirmationForDangerousActions", settings.confirmationForDangerousActions); confirmationDialogs = new SimpleBooleanProperty(null, "confirmationForDangerousActions", settings.confirmationForDangerousActions);
naCamsOnly = new SimpleBooleanProperty(null, "filterNAcamsOnly", settings.filterNAcamsOnly != null ? settings.filterNAcamsOnly : false);
naCamsOnly.addListener((obs, oldValue, newValue) -> { settings.filterNAcamsOnly = newValue; saveConfig();});
useHlsdl = new SimpleBooleanProperty(null, "useHlsdl", settings.useHlsdl); useHlsdl = new SimpleBooleanProperty(null, "useHlsdl", settings.useHlsdl);
hlsdlExecutable = new SimpleFileProperty(null, "hlsdlExecutable", settings.hlsdlExecutable); hlsdlExecutable = new SimpleFileProperty(null, "hlsdlExecutable", settings.hlsdlExecutable);
recentlyWatched = new SimpleBooleanProperty(null, "recentlyWatched", settings.recentlyWatched); recentlyWatched = new SimpleBooleanProperty(null, "recentlyWatched", settings.recentlyWatched);
@ -257,6 +260,7 @@ public class SettingsTab extends Tab implements TabSelectionListener {
Setting.of("Start minimized", startMinimized, "Start the app minimized to the tray, automatically activates \"Minimize to tray\""), Setting.of("Start minimized", startMinimized, "Start the app minimized to the tray, automatically activates \"Minimize to tray\""),
Setting.of("Add models from clipboard", monitorClipboard, "Monitor clipboard for model URLs and automatically add them to the recorder").needsRestart(), Setting.of("Add models from clipboard", monitorClipboard, "Monitor clipboard for model URLs and automatically add them to the recorder").needsRestart(),
Setting.of("Show confirmation dialogs", confirmationDialogs, "Show confirmation dialogs for irreversible actions"), Setting.of("Show confirmation dialogs", confirmationDialogs, "Show confirmation dialogs for irreversible actions"),
Setting.of("Show only North America Cams", naCamsOnly, "Show only North America Cams"),
Setting.of("Recording tab per site", recordedModelsPerSite, "Add a Recording tab for each site").needsRestart(), Setting.of("Recording tab per site", recordedModelsPerSite, "Add a Recording tab for each site").needsRestart(),
Setting.of("Check for new versions at startup", checkForUpdates, "Search for updates every startup"), Setting.of("Check for new versions at startup", checkForUpdates, "Search for updates every startup"),
Setting.of("Start Tab", startTab)), Setting.of("Start Tab", startTab)),

View File

@ -1,5 +1,6 @@
package ctbrec.ui.sites.chaturbate; package ctbrec.ui.sites.chaturbate;
import ctbrec.Config;
import ctbrec.sites.chaturbate.Chaturbate; import ctbrec.sites.chaturbate.Chaturbate;
import ctbrec.ui.sites.AbstractTabProvider; import ctbrec.ui.sites.AbstractTabProvider;
import ctbrec.ui.tabs.PaginatedScheduledService; import ctbrec.ui.tabs.PaginatedScheduledService;
@ -14,40 +15,45 @@ public class ChaturbateTabProvider extends AbstractTabProvider {
private final String apiUrl; private final String apiUrl;
private final ChaturbateFollowedTab followedTab; private final ChaturbateFollowedTab followedTab;
private final boolean regionNAEnabled; // Store the setting
public ChaturbateTabProvider(Chaturbate chaturbate) { public ChaturbateTabProvider(Chaturbate chaturbate) {
super(chaturbate); super(chaturbate);
apiUrl = site.getBaseUrl() + "/api/ts"; apiUrl = site.getBaseUrl() + "/api/ts";
this.followedTab = new ChaturbateFollowedTab("Followed", apiUrl + "/roomlist/room-list/?enable_recommendations=false&follow=true", chaturbate); regionNAEnabled = Config.getInstance().getSettings().filterNAcamsOnly; // Load setting from Config
this.followedTab = new ChaturbateFollowedTab("Followed", buildUrl("/roomlist/room-list/?enable_recommendations=false&follow=true"), chaturbate);
} }
@Override @Override
protected List<Tab> getSiteTabs(Scene scene) { protected List<Tab> getSiteTabs(Scene scene) {
List<Tab> tabs = new ArrayList<>(); List<Tab> tabs = new ArrayList<>();
tabs.add(createTab("Featured", apiUrl + "/roomlist/room-list/?enable_recommendations=false")); tabs.add(createTab("Featured", buildUrl("/roomlist/room-list/?enable_recommendations=false")));
tabs.add(createTab("Female", apiUrl + "/roomlist/room-list/?enable_recommendations=false&genders=f")); tabs.add(createTab("Female", buildUrl("/roomlist/room-list/?enable_recommendations=false&genders=f")));
tabs.add(createTab("New Female", apiUrl + "/roomlist/room-list/?enable_recommendations=false&genders=f&new_cams=true")); tabs.add(createTab("New Female", buildUrl("/roomlist/room-list/?enable_recommendations=false&genders=f&new_cams=true")));
tabs.add(createTab("Milf", apiUrl + "/roomlist/room-list/?enable_recommendations=false&hashtags=milf")); tabs.add(createTab("Milf", buildUrl("/roomlist/room-list/?enable_recommendations=false&hashtags=milf")));
tabs.add(createTab("Teen", apiUrl + "/roomlist/room-list/?enable_recommendations=false&hashtags=teen")); tabs.add(createTab("Teen", buildUrl("/roomlist/room-list/?enable_recommendations=false&hashtags=teen")));
tabs.add(createTab("Creampie", apiUrl + "/roomlist/room-list/?enable_recommendations=false&hashtags=creampie")); tabs.add(createTab("Creampie", buildUrl("/roomlist/room-list/?enable_recommendations=false&hashtags=creampie")));
tabs.add(createTab("BBW", apiUrl + "/roomlist/room-list/?enable_recommendations=false&hashtags=bbw")); tabs.add(createTab("BBW", buildUrl("/roomlist/room-list/?enable_recommendations=false&hashtags=bbw")));
tabs.add(createTab("Chubby", apiUrl + "/roomlist/room-list/?enable_recommendations=false&hashtags=chubby")); tabs.add(createTab("Chubby", buildUrl("/roomlist/room-list/?enable_recommendations=false&hashtags=chubby")));
tabs.add(createTab("Pregnant", apiUrl + "/roomlist/room-list/?enable_recommendations=false&hashtags=pregnant")); tabs.add(createTab("Pregnant", buildUrl("/roomlist/room-list/?enable_recommendations=false&hashtags=pregnant")));
tabs.add(createTab("Male", apiUrl + "/roomlist/room-list/?enable_recommendations=false&genders=m")); tabs.add(createTab("Male", buildUrl("/roomlist/room-list/?enable_recommendations=false&genders=m")));
tabs.add(createTab("New Male", apiUrl + "/roomlist/room-list/?enable_recommendations=false&genders=m&new_cams=true")); tabs.add(createTab("New Male", buildUrl("/roomlist/room-list/?enable_recommendations=false&genders=m&new_cams=true")));
tabs.add(createTab("Couples", apiUrl + "/roomlist/room-list/?enable_recommendations=false&genders=c")); tabs.add(createTab("Couples", buildUrl("/roomlist/room-list/?enable_recommendations=false&genders=c")));
tabs.add(createTab("Trans", apiUrl + "/roomlist/room-list/?enable_recommendations=false&genders=t")); tabs.add(createTab("Trans", buildUrl("/roomlist/room-list/?enable_recommendations=false&genders=t")));
tabs.add(createTab("N.American Cams", apiUrl + "/roomlist/room-list/?enable_recommendations=false&regions=NA")); tabs.add(createTab("N.American Cams", buildUrl("/roomlist/room-list/?enable_recommendations=false&regions=NA")));
tabs.add(createTab("6TPM private", apiUrl + "/roomlist/room-list/?enable_recommendations=false&private_prices=6")); tabs.add(createTab("6TPM private", buildUrl("/roomlist/room-list/?enable_recommendations=false&private_prices=6")));
tabs.add(createTab("Private", apiUrl + "/roomlist/room-list/?enable_recommendations=false&private=true")); tabs.add(createTab("Private", buildUrl("/roomlist/room-list/?enable_recommendations=false&private=true")));
tabs.add(createTab("Hidden", apiUrl + "/roomlist/room-list/?enable_recommendations=false&hidden=true")); tabs.add(createTab("Hidden", buildUrl("/roomlist/room-list/?enable_recommendations=false&hidden=true")));
tabs.add(createTab("Gaming", apiUrl + "/roomlist/room-list/?enable_recommendations=false&gaming=true")); tabs.add(createTab("Gaming", buildUrl("/roomlist/room-list/?enable_recommendations=false&gaming=true")));
followedTab.setScene(scene); followedTab.setScene(scene);
followedTab.setRecorder(recorder); followedTab.setRecorder(recorder);
followedTab.setImageAspectRatio(9.0 / 16.0); followedTab.setImageAspectRatio(9.0 / 16.0);
tabs.add(followedTab); tabs.add(followedTab);
tabs.add(createApiTab("Top Rated", apiUrl + "/discover/carousels/top-rated/"));
tabs.add(createApiTab("Trending", apiUrl + "/discover/carousels/trending/")); tabs.add(createApiTab("Top Rated", buildUrl("/discover/carousels/top-rated/")));
tabs.add(createApiTab("Trending", buildUrl("/discover/carousels/trending/")));
return tabs; return tabs;
} }
@ -72,4 +78,9 @@ public class ChaturbateTabProvider extends AbstractTabProvider {
var updateService = new ChaturbateApiUpdateService(apiUrl, (Chaturbate) site); var updateService = new ChaturbateApiUpdateService(apiUrl, (Chaturbate) site);
return createTab(title, updateService); return createTab(title, updateService);
} }
// Helper function to append region filter if enabled
private String buildUrl(String endpoint) {
return apiUrl + endpoint + (regionNAEnabled ? "&region=NA" : "");
}
} }