Private download

This commit is contained in:
2025-11-16 17:43:35 -05:00
parent fa5b7a3249
commit 1922cf5b87
5 changed files with 1336 additions and 821 deletions

View File

@@ -1,6 +1,7 @@
'use strict';
module.exports = {
privateDownloadLocation: '/media/torrents-zfs',
ldap: {
url: 'ldap://10.1.0.55:389',
bindDN: 'cn=ldapclient service,ou=people,dc=theta42,dc=com',

4
conf/development.js Normal file
View File

@@ -0,0 +1,4 @@
'use strict';
module.exports = {
};

View File

@@ -37,7 +37,11 @@ module.exports = (sequelize, DataTypes, Model) => {
await this.build(data).validate();
// console.log('validate', val);
let res = await tr_client.addUrl(data.magnetLink);
let options = {
'download-dir': data.isPrivate === 'true' ? `${conf.privateDownloadLocation}/${data.added_by}` : undefined,
};
let res = await tr_client.addUrl(data.magnetLink, options);
return await super.create({
magnetLink: data.magnetLink,

2130
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -101,6 +101,7 @@
<style type="text/css">
#tbp_proxy_torrent_dialog{
padding: 0;
overflow-x: scroll;
}
#tbp_proxy_torrent_dialog progress{
@@ -238,14 +239,14 @@
<input type="text" name="hashString" value="{{{hashString}}}" readonly/>
</p>
<p style="display:none">
<p>
<legend>Public Download:</legend>
<label for="radio-1" title="The download will appare in the communal download folder">Public</label>
<input type="radio" name="isPrivate" id="radio-1" value="true" checked readonly/>
<input type="radio" name="isPrivate" id="radio-1" value="false" checked readonly/>
<label for="radio-2" title="Only you(and the admins) will be able to see this download">Private</label>
<input type="radio" name="isPrivate" id="radio-2" value="false" readonly/>
<input type="radio" name="isPrivate" id="radio-2" value="true" readonly/>
</p>
<p style="display:none">
@@ -260,7 +261,7 @@
<hr />
<button type="submit">Start Download</button>
<button onclick="$('#tbp_proxy_torrent_add_dialog').dialog('close')">Cancel</button>
<button type="reset" onclick="$('#tbp_proxy_torrent_add_dialog').dialog('close')">Cancel</button>
</form>
</div>
</div>
@@ -307,7 +308,12 @@
$( "#tbp_proxy_torrent_dialog" ).dialog(commonDialogOptions);
$( "#tbp_proxy_torrent_dialog_opener" ).on( "click", function() {
$( "#tbp_proxy_torrent_dialog" ).parent().css({position:"fixed", 'margin-right': "2em", 'margin-top': '3em'}).end().dialog( "open" );
if($( "#tbp_proxy_torrent_dialog" ).dialog( "isOpen" )){
$( "#tbp_proxy_torrent_dialog" ).dialog( "close" )
}else{
$( "#tbp_proxy_torrent_dialog" ).parent().css({position:"fixed", 'margin-right': "2em", 'margin-top': '3em'}).end().dialog( "open" );
}
});