76 lines
2.7 KiB
Java
76 lines
2.7 KiB
Java
package ctbrec.ui.sites.stripchat;
|
|
|
|
import ctbrec.sites.stripchat.Stripchat;
|
|
import ctbrec.ui.settings.Sites;
|
|
import ctbrec.ui.settings.TabUtils;
|
|
import ctbrec.ui.sites.AbstractTabProvider;
|
|
import ctbrec.ui.tabs.ThumbOverviewTab;
|
|
import javafx.scene.Scene;
|
|
import javafx.scene.control.Tab;
|
|
|
|
import java.text.MessageFormat;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
public class StripchatTabProvider extends AbstractTabProvider {
|
|
|
|
private final String urlTemplate;
|
|
private final String urlFilterTemplate;
|
|
private final StripchatFollowedTab followedTab;
|
|
|
|
public StripchatTabProvider(Stripchat stripchat) {
|
|
super(stripchat);
|
|
followedTab = new StripchatFollowedTab("Followed", stripchat);
|
|
urlTemplate = stripchat.getBaseUrl() + "/api/front/models?primaryTag={0}&sortBy=viewersRating&withMixedTags=true&parentTag=";
|
|
urlFilterTemplate = stripchat.getBaseUrl() + "/api/front/models?primaryTag=girls&filterGroupTags=%5B%5B%22{0}%22%5D%5D&parentTag={0}";
|
|
}
|
|
|
|
@Override
|
|
protected List<Tab> getSiteTabs(Scene scene) {
|
|
List<Tab> tabs = new ArrayList<>();
|
|
|
|
Map<String, String> tabMap = new HashMap<>();
|
|
tabMap.put("girls", "Girls");
|
|
tabMap.put("autoTagNew", "Girls New");
|
|
tabMap.put("autoTagHd", "Girls HD");
|
|
tabMap.put("autoTagVr", "Girls VR");
|
|
tabMap.put("mobile", "Mobile");
|
|
tabMap.put("autoTagSpy", "Private");
|
|
tabMap.put("couples", "Couples");
|
|
tabMap.put("men", "Boys");
|
|
tabMap.put("trans", "Trans");
|
|
List<String> enabledTabs = TabUtils.getEnabledTabs(Sites.STRIPCHAT);
|
|
for (String tab : enabledTabs) {
|
|
String title = tabMap.getOrDefault(tab, tab);
|
|
if (tab.contains("auto") || (tab.contains("mobile"))) {
|
|
tabs.add(createTab(title, MessageFormat.format(urlFilterTemplate, tab)));
|
|
} else {
|
|
tabs.add(createTab(title, MessageFormat.format(urlTemplate, tab)));
|
|
}
|
|
|
|
}
|
|
// tabs.add(createTab("Girls VR", MessageFormat.format(urlFilterTemplate, "autoTagVr")));
|
|
|
|
followedTab.setRecorder(recorder);
|
|
followedTab.setScene(scene);
|
|
followedTab.setImageAspectRatio(9.0 / 16.0);
|
|
tabs.add(followedTab);
|
|
return tabs;
|
|
}
|
|
|
|
@Override
|
|
public Tab getFollowedTab() {
|
|
return followedTab;
|
|
}
|
|
|
|
private Tab createTab(String title, String url) {
|
|
var updateService = new StripchatUpdateService(url, false, (Stripchat) site);
|
|
var tab = new ThumbOverviewTab(title, updateService, site);
|
|
tab.setRecorder(recorder);
|
|
tab.setImageAspectRatio(9.0 / 16.0);
|
|
return tab;
|
|
}
|
|
}
|