Code cleanup
This commit is contained in:
parent
505e641eb9
commit
97b4aa992f
|
@ -1,17 +1,5 @@
|
|||
package ctbrec.ui.sites.bonga;
|
||||
|
||||
import static ctbrec.io.HttpConstants.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ctbrec.Config;
|
||||
import ctbrec.Model;
|
||||
import ctbrec.sites.bonga.BongaCams;
|
||||
|
@ -20,14 +8,25 @@ import ctbrec.ui.SiteUiFactory;
|
|||
import ctbrec.ui.tabs.PaginatedScheduledService;
|
||||
import javafx.concurrent.Task;
|
||||
import okhttp3.Request;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import static ctbrec.io.HttpConstants.*;
|
||||
|
||||
public class BongaCamsUpdateService extends PaginatedScheduledService {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(BongaCamsUpdateService.class);
|
||||
|
||||
private BongaCams bongaCams;
|
||||
private String url;
|
||||
private boolean requiresLogin;
|
||||
private final BongaCams bongaCams;
|
||||
private final String url;
|
||||
private final boolean requiresLogin;
|
||||
|
||||
public BongaCamsUpdateService(BongaCams bongaCams, String url) {
|
||||
this(bongaCams, url, false);
|
||||
|
@ -41,7 +40,7 @@ public class BongaCamsUpdateService extends PaginatedScheduledService {
|
|||
|
||||
@Override
|
||||
protected Task<List<Model>> createTask() {
|
||||
return new Task<List<Model>>() {
|
||||
return new Task<>() {
|
||||
@Override
|
||||
public List<Model> call() throws IOException {
|
||||
if (requiresLogin) {
|
||||
|
@ -54,7 +53,7 @@ public class BongaCamsUpdateService extends PaginatedScheduledService {
|
|||
}
|
||||
|
||||
private List<Model> loadModelList() throws IOException {
|
||||
String pageUrl = url + ((page-1) * 36);
|
||||
String pageUrl = url + ((page - 1) * 36);
|
||||
LOG.debug("Fetching page {}", pageUrl);
|
||||
var request = new Request.Builder()
|
||||
.url(pageUrl)
|
||||
|
|
Loading…
Reference in New Issue