refactor options
This commit is contained in:
@@ -34,11 +34,17 @@ import java.util.Date;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import yugecin.opsudance.core.errorhandling.ErrorHandler;
|
||||
import yugecin.opsudance.core.inject.Inject;
|
||||
import yugecin.opsudance.core.inject.InstanceContainer;
|
||||
|
||||
/**
|
||||
* Download server: http://bloodcat.com/osu/
|
||||
*/
|
||||
public class BloodcatServer extends DownloadServer {
|
||||
|
||||
@Inject
|
||||
public InstanceContainer instanceContainer;
|
||||
|
||||
/** Server name. */
|
||||
private static final String SERVER_NAME = "Bloodcat";
|
||||
|
||||
@@ -54,8 +60,9 @@ public class BloodcatServer extends DownloadServer {
|
||||
/** Total result count from the last query. */
|
||||
private int totalResults = -1;
|
||||
|
||||
/** Constructor. */
|
||||
public BloodcatServer() {}
|
||||
@Inject
|
||||
public BloodcatServer() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() { return SERVER_NAME; }
|
||||
@@ -82,12 +89,12 @@ public class BloodcatServer extends DownloadServer {
|
||||
nodes = new DownloadNode[arr.length()];
|
||||
for (int i = 0; i < nodes.length; i++) {
|
||||
JSONObject item = arr.getJSONObject(i);
|
||||
nodes[i] = new DownloadNode(
|
||||
nodes[i] = instanceContainer.injectFields(new DownloadNode(
|
||||
item.getInt("id"), formatDate(item.getString("synced")), //"date"
|
||||
item.getString("title"), item.isNull("titleU") ? null : item.getString("titleU"), //"titleUnicode"
|
||||
item.getString("artist"), item.isNull("artistU") ? null : item.getString("artistU"), //"artistUnicode"
|
||||
item.getString("creator")
|
||||
);
|
||||
));
|
||||
}
|
||||
|
||||
// store total result count
|
||||
|
||||
Reference in New Issue
Block a user