Commit 319c7fb7 authored by Alain Takoudjou's avatar Alain Takoudjou

erp5_web_mynij_search: fixup! remove torrent when seed is disabled

parent 2784739b
...@@ -535,17 +535,19 @@ ...@@ -535,17 +535,19 @@
gadget.state.seed_index[item.id] = {}; gadget.state.seed_index[item.id] = {};
promise_list.push(gadget.seedIndex(item.id)); promise_list.push(gadget.seedIndex(item.id));
console.log("call seed to " + item.id); console.log("call seed to " + item.id);
} else if (gadget.state.seed_index.hasOwnProperty(item.id)) { } else if (!item.value.seed || item.value.seed === "off") {
// remove torrent seed if (gadget.state.seed_index.hasOwnProperty(item.id)) {
torrent_id = gadget.state.seed_index[item.id].infoHash // remove torrent seed
gadget.state.seed_index[item.id].destroy(function () { torrent_id = gadget.state.seed_index[item.id].infoHash
var element = torrentHtmlElement(torrent_id); gadget.state.seed_index[item.id].destroy(function () {
console.log("Torrent of '" + item.value.title + var element = torrentHtmlElement(torrent_id);
"' destroyed..."); console.log("Torrent of '" + item.value.title +
if (element) "' destroyed...");
element.remove(); if (element)
}); element.remove();
delete gadget.state.seed_index[item.id]; });
delete gadget.state.seed_index[item.id];
}
} }
} }
return RSVP.all(promise_list); return RSVP.all(promise_list);
......
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>989.30643.58517.13209</string> </value> <value> <string>989.30650.55487.8328</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1611167690.79</float> <float>1611221391.77</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment