Browse Source

Merge remote-tracking branch 'origin/dev'

# Conflicts:
#	app/src/main/java/org/transdroid/daemon/task/AddByMagnetUrlTask.java
#	app/src/main/java/org/transdroid/daemon/task/AddByUrlTask.java
pull/585/head
Eric Kok 4 years ago
parent
commit
254588a253
  1. 24
      app/src/main/java/org/transdroid/daemon/task/AddByMagnetUrlTask.java
  2. 33
      app/src/main/java/org/transdroid/daemon/task/AddByUrlTask.java

24
app/src/main/java/org/transdroid/daemon/task/AddByMagnetUrlTask.java

@ -23,17 +23,15 @@ import org.transdroid.daemon.DaemonMethod;
import org.transdroid.daemon.IDaemonAdapter; import org.transdroid.daemon.IDaemonAdapter;
public class AddByMagnetUrlTask extends DaemonTask { public class AddByMagnetUrlTask extends DaemonTask {
protected AddByMagnetUrlTask(IDaemonAdapter adapter, Bundle data) { protected AddByMagnetUrlTask(IDaemonAdapter adapter, Bundle data) {
super(adapter, DaemonMethod.AddByMagnetUrl, null, data); super(adapter, DaemonMethod.AddByMagnetUrl, null, data);
} }
public static AddByMagnetUrlTask create(IDaemonAdapter adapter, String url) {
public static AddByMagnetUrlTask create(IDaemonAdapter adapter, String url) { Bundle data = new Bundle();
Bundle data = new Bundle(); data.putString("URL", url);
data.putString("URL", url); return new AddByMagnetUrlTask(adapter, data);
return new AddByMagnetUrlTask(adapter, data); }
} public String getUrl() {
return extras.getString("URL").replaceAll("\\s", "");
public String getUrl() { }
return extras.getString("URL");
}
} }

33
app/src/main/java/org/transdroid/daemon/task/AddByUrlTask.java

@ -23,22 +23,19 @@ import org.transdroid.daemon.DaemonMethod;
import org.transdroid.daemon.IDaemonAdapter; import org.transdroid.daemon.IDaemonAdapter;
public class AddByUrlTask extends DaemonTask { public class AddByUrlTask extends DaemonTask {
protected AddByUrlTask(IDaemonAdapter adapter, Bundle data) { protected AddByUrlTask(IDaemonAdapter adapter, Bundle data) {
super(adapter, DaemonMethod.AddByUrl, null, data); super(adapter, DaemonMethod.AddByUrl, null, data);
} }
public static AddByUrlTask create(IDaemonAdapter adapter, String url, String title) {
public static AddByUrlTask create(IDaemonAdapter adapter, String url, String title) { Bundle data = new Bundle();
Bundle data = new Bundle(); data.putString("URL", url);
data.putString("URL", url); data.putString("TITLE", title);
data.putString("TITLE", title); return new AddByUrlTask(adapter, data);
return new AddByUrlTask(adapter, data); }
} public String getUrl() {
return extras.getString("URL").replaceAll("\\s", "");
public String getUrl() { }
return extras.getString("URL"); public String getTitle() {
} return extras.getString("TITLE");
}
public String getTitle() {
return extras.getString("TITLE");
}
} }

Loading…
Cancel
Save