Added TorrServer instance support! 🎞 (#1603)

* Added integration with TorrServe 🎞

* Updated

* Updated

* Update functions.php

* Updated

* Update functions.php

* Update functions.php

* Updated

* Update TorrServerAPI.php

* Updated

* Updated

* Updated

* Updated

* Updated

* Updated

* Update TorrServerAPI.php

* Update TorrServerAPI.php

* Update TorrServerAPI.php

* Updated

* Updated

* Update config.php

* Update Attach.php

* Update Torrent.php

* Update CHANGELOG.md

* Update TorrServerAPI.php

* Update TorrServerAPI.php

* Update displaying_torrent.php

* Update Torrent.php

* Update TorrServerAPI.php

* Update TorrServerAPI.php

* Update TorrServerAPI.php

* Update TorrServerAPI.php

* Update TorrServerAPI.php

* Updated

* Update viewtopic_attach.tpl

* Updated

* Update tor_m3u_format.svg

* Updated

* Updated

* Update tor_m3u_format.png

* Update TorrServerAPI.php

* Update TorrServerAPI.php

* Updated

* Update Torrent.php

* Update functions_delete.php

* Updated

* Update TorrServerAPI.php

* Updated

* Updated

* Updated

* Update TorrServerAPI.php

* Update TorrServerAPI.php

* Update displaying_torrent.php

* Update TorrServerAPI.php

* Update CHANGELOG.md

Co-Authored-By: YouROK <4067300+yourok@users.noreply.github.com>

---------

Co-authored-by: YouROK <4067300+yourok@users.noreply.github.com>
This commit is contained in:
Roman Kelesidis 2024-08-20 22:16:49 +07:00 committed by GitHub
commit c6b4672734
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 344 additions and 5 deletions

View file

@ -16,7 +16,8 @@
*/
function delete_attachment($post_id_array = 0, $attach_id_array = 0, $page = 0, $user_id = 0)
{
$lang = [];
global $lang, $bb_cfg;
// Generate Array, if it's not an array
if ($post_id_array === 0 && $attach_id_array === 0 && $page === 0) {
return;
@ -185,6 +186,12 @@ function delete_attachment($post_id_array = 0, $attach_id_array = 0, $page = 0,
DB()->sql_freeresult($result);
if ($num_rows == 0) {
// TorrServer integration
if ($bb_cfg['torr_server']['enabled']) {
$torrServer = new \TorrentPier\TorrServerAPI();
$torrServer->removeM3U($attach_id_array[$i]);
}
$sql = 'SELECT attach_id, physical_filename, thumbnail
FROM ' . BB_ATTACHMENTS_DESC . '
WHERE attach_id = ' . (int)$attach_id_array[$i];