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 @@
gadget.state.seed_index[item.id] = {};
promise_list.push(gadget.seedIndex(item.id));
console.log("call seed to " + item.id);
} else if (gadget.state.seed_index.hasOwnProperty(item.id)) {
// remove torrent seed
torrent_id = gadget.state.seed_index[item.id].infoHash
gadget.state.seed_index[item.id].destroy(function () {
var element = torrentHtmlElement(torrent_id);
console.log("Torrent of '" + item.value.title +
"' destroyed...");
if (element)
element.remove();
});
delete gadget.state.seed_index[item.id];
} else if (!item.value.seed || item.value.seed === "off") {
if (gadget.state.seed_index.hasOwnProperty(item.id)) {
// remove torrent seed
torrent_id = gadget.state.seed_index[item.id].infoHash
gadget.state.seed_index[item.id].destroy(function () {
var element = torrentHtmlElement(torrent_id);
console.log("Torrent of '" + item.value.title +
"' destroyed...");
if (element)
element.remove();
});
delete gadget.state.seed_index[item.id];
}
}
}
return RSVP.all(promise_list);
......
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>989.30643.58517.13209</string> </value>
<value> <string>989.30650.55487.8328</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1611167690.79</float>
<float>1611221391.77</float>
<string>UTC</string>
</tuple>
</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