diff --git a/src/core.py b/src/core.py index a751dad8e..f64956bc8 100644 --- a/src/core.py +++ b/src/core.py @@ -1026,3 +1026,6 @@ class Manager: if speed != -1: speed = speed * 1024 return deluge_core.set_per_download_rate_limit(unique_ID, speed) + + def add_url_seed(self, unique_ID, address): + return deluge_core.add_url_seed(unique_ID, address) diff --git a/src/deluge_core.cpp b/src/deluge_core.cpp index cad3c64ba..8b5bf6c3b 100644 --- a/src/deluge_core.cpp +++ b/src/deluge_core.cpp @@ -1891,12 +1891,30 @@ static PyObject *torrent_set_max_upload_slots_per_torrent(PyObject *self, PyObje return Py_None; } +static PyObject *torrent_add_url_seed(PyObject *self, PyObject *args) +{ + python_long unique_ID; + std::string address; + + if (!PyArg_ParseTuple(args, "is", &unique_ID, &address)) + return NULL; + long index = get_index_from_unique_ID(unique_ID); + if (PyErr_Occurred()) + return NULL; + + torrent_t &t = M_torrents->at(index); + t.handle.add_url_seed(address); + + return Py_None; +} + //==================== // Python Module data //==================== static PyMethodDef deluge_core_methods[] = { + {"add_url_seed", torrent_pe_settings, METH_VARARGS, "."}, {"pe_settings", torrent_pe_settings, METH_VARARGS, "."}, {"pre_init", torrent_pre_init, METH_VARARGS, "."}, {"init", torrent_init, METH_VARARGS, "."},