fix top rated and trending
This commit is contained in:
parent
1c1066d399
commit
ceceb4dd6e
|
@ -51,8 +51,10 @@ public class ChaturbateTabProvider extends AbstractTabProvider {
|
|||
followedTab.setImageAspectRatio(9.0 / 16.0);
|
||||
tabs.add(followedTab);
|
||||
|
||||
tabs.add(createApiTab("Top Rated", buildUrl("/discover/carousels/top-rated/")));
|
||||
tabs.add(createApiTab("Trending", buildUrl("/discover/carousels/trending/")));
|
||||
//tabs.add(createApiTab("Top Rated", buildUrl("/discover/carousels/top-rated/")));
|
||||
//tabs.add(createApiTab("Trending", buildUrl("/discover/carousels/trending/")));
|
||||
tabs.add(createApiTab("Top Rated", apiUrl + "/discover/carousels/top-rated/"));
|
||||
tabs.add(createApiTab("Trending", apiUrl + "/discover/carousels/trending/"));
|
||||
|
||||
return tabs;
|
||||
}
|
||||
|
@ -82,14 +84,22 @@ public class ChaturbateTabProvider extends AbstractTabProvider {
|
|||
private String buildUrl(String endpoint) {
|
||||
boolean filterNA = Config.getInstance().getSettings().filterNAcamsOnly; // Always check latest setting
|
||||
|
||||
// Ensure that certain tabs remain unchanged
|
||||
if (endpoint.contains("®ions=NA") || endpoint.contains("&hidden=true") || endpoint.contains("&gaming=true")) {
|
||||
return apiUrl + endpoint; // Do NOT modify these URLs
|
||||
// Do NOT modify "N.American Cams" - it should always have ®ions=NA
|
||||
if (endpoint.contains("®ions=NA")) {
|
||||
return apiUrl + endpoint; // Keep it unchanged
|
||||
}
|
||||
|
||||
// Apply ®ions=NA dynamically to other endpoints based on the checkbox setting
|
||||
String url = apiUrl + endpoint + (filterNA ? "®ions=NA" : "");
|
||||
System.out.println("Building URL: " + url); // Debugging line
|
||||
// Ensure Top Rated & Trending use ? instead of &
|
||||
if (filterNA && endpoint.contains("discover/carousels")) {
|
||||
endpoint += "?regions=NA"; // Use ? instead of &
|
||||
}
|
||||
// For all other tabs (except N.American Cams), append ®ions=NA if enabled
|
||||
else if (filterNA) {
|
||||
endpoint += "®ions=NA";
|
||||
}
|
||||
|
||||
String url = apiUrl + endpoint;
|
||||
System.out.println("Building URL: " + url); // Debugging output
|
||||
return url;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue