Commit fdec656c authored by Alain Takoudjou's avatar Alain Takoudjou

erp5_web_mynij_search: minor changes

add magnet_uri to souce form
add new tracker URL
destroy torrent when download is finished (to prevent client to automatically start to seed the torrent)
parent 9ba7ef01
......@@ -83,7 +83,7 @@
.push(function (model) {
return gadget.changeState({
model_gadget: model,
client: new WebTorrent(),
client: null,
seed_index: {}
});
});
......@@ -302,6 +302,12 @@
})
})
.push(function () {
// stop seeding the torrent
gadget.state.client.destroy(function (err) {
if (err) {
console.error(err.stack || err.message || err);
}
});
if (gadget.state.redirect) {
return gadget.redirect({command: 'display', options: {
page: gadget.state.redirect
......@@ -320,7 +326,11 @@
key_list = [];
if (!container)
return;
info = container.querySelector('h2.info')
key_list = Object.keys(gadget.state.seed_index);
if (!key_list.length) {
info.innerText = "There is no torrent peer seeding!";
}
for (i = 0; i < key_list.length; i += 1) {
let torrent = gadget.state.seed_index[key_list[i]];
if (!torrent.ready) {
......@@ -330,7 +340,6 @@
// already present
continue;
}
info = container.querySelector('h2.info')
if (info) {
info.remove();
}
......@@ -434,7 +443,8 @@
announceList: [
['wss://tracker.fastcast.nz'],
['wss://tracker.openwebtorrent.com'],
['wss://tracker.btorrent.xyz']
['wss://tracker.btorrent.xyz'],
['wss://softinst140244.host.vifib.net']
],
comment: index_doc.title
},
......@@ -474,6 +484,7 @@
});
}
gadget.state.client = new WebTorrent();
return seedTorrent();
})
......@@ -485,6 +496,7 @@
if (!torrent_id) {
return;
}
gadget.state.client = new WebTorrent();
gadget.state.redirect = redirect;
container.classList.remove('hidden');
return gadget.notifySubmitting()
......
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>988.62605.47794.56695</string> </value>
<value> <string>989.18558.11562.17885</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1609936717.76</float>
<float>1610442308.5</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -62,12 +62,15 @@
continue;
if (entry.status && !build_dict[key].status)
entry = build_dict[key];
else if (entry.status === "built" &&
build_dict[key].status !== "built")
else if ((entry.status === "built" ||
entry.status === "built failed") &&
(build_dict[key].status !== "built" &&
build_dict[key].status !== "built failed"))
entry = build_dict[key];
}
}
if (entry && entry.status === 'built')
if (entry && (entry.status === 'built' ||
entry.status === "built failed"))
return;
return entry;
});
......
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>989.8577.12361.41625</string> </value>
<value> <string>989.8588.57452.32853</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1609843972.59</float>
<float>1610530616.84</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -58,6 +58,7 @@
}
.torrent-seed .info, .torrent-download .info {
font-size: 1.1em;
color: #ff6a00;
padding-bottom: 10px;
font-size: .9em;
}
\ No newline at end of file
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>988.48444.33021.4471</string> </value>
<value> <string>989.8572.38390.65228</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1609842995.14</float>
<float>1610441747.87</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -256,7 +256,7 @@
</item>
<item>
<key> <string>configuration_content_security_policy</string> </key>
<value> <string>default-src \'self\'; img-src \'self\' data:; media-src \'self\' blob:; connect-src \'self\' https://content.dropboxapi.com https://api.dropboxapi.com wss://tracker.fastcast.nz wss://tracker.openwebtorrent.com wss://tracker.btorrent.xyz data: *.host.vifib.net *.node.vifib.com *.erp5.net https://cors-anywhere.herokuapp.com/; script-src \'self\' \'unsafe-eval\' \'unsafe-inline\'; font-src \'self\'; style-src \'self\' \'unsafe-inline\' data:; frame-src \'self\' data:</string> </value>
<value> <string>default-src \'self\'; img-src \'self\' data:; media-src \'self\' blob:; connect-src \'self\' https://content.dropboxapi.com https://api.dropboxapi.com wss://tracker.fastcast.nz wss://tracker.openwebtorrent.com wss://tracker.btorrent.xyz wss://softinst140244.host.vifib.net data: *.host.vifib.net *.node.vifib.com *.erp5.net https://cors-anywhere.herokuapp.com/; script-src \'self\' \'unsafe-eval\' \'unsafe-inline\'; font-src \'self\'; style-src \'self\' \'unsafe-inline\' data:; frame-src \'self\' data:</string> </value>
</item>
<item>
<key> <string>configuration_default_jio_document_page_gadget_url</string> </key>
......@@ -514,7 +514,7 @@ WebSection_getMynijSearchPrecacheManifestList</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>987.37947.26336.35635</string> </value>
<value> <string>988.15217.51476.33467</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -532,7 +532,7 @@ WebSection_getMynijSearchPrecacheManifestList</string> </value>
</tuple>
<state>
<tuple>
<float>1606395947.12</float>
<float>1610378353.26</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -128,7 +128,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Confirm import</string> </value>
<value> <string>Import index from .zip file</string> </value>
</item>
</dictionary>
</value>
......
......@@ -128,7 +128,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Confirm import Sources</string> </value>
<value> <string>Load Sources from .json file</string> </value>
</item>
</dictionary>
</value>
......
......@@ -79,6 +79,7 @@
<string>my_title</string>
<string>my_links</string>
<string>my_seed</string>
<string>my_magnet_uri</string>
<string>my_status</string>
</list>
</value>
......
......@@ -32,7 +32,8 @@ url_list = [
"flexsearch_en.js",
"mynij_rss-parser.min.js",
"rss-parser.min.js.map",
"webtorrent.min.js"
"webtorrent.min.js",
"jszip.min.js"
]
return url_list
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