Minor improvements (#1605)

* Minor improvements

* Updated

* Update functions_delete.php

* Update attach_maintenance.php

* Update attach_maintenance.php

* Update config.php

* Updated

* Update viewtopic_attach.tpl

* Updated

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2024-08-21 01:41:57 +07:00 committed by GitHub
commit 82e7552a9e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 22 additions and 15 deletions

View file

@ -186,12 +186,6 @@ 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];
@ -219,6 +213,12 @@ function delete_attachment($post_id_array = 0, $attach_id_array = 0, $page = 0,
if (!(DB()->sql_query($sql))) {
bb_die($lang['ERROR_DELETED_ATTACHMENTS']);
}
// TorrServer integration
if ($bb_cfg['torr_server']['enabled']) {
$torrServer = new \TorrentPier\TorrServerAPI();
$torrServer->removeM3U($attachments[$j]['attach_id']);
}
}
} else {
DB()->sql_freeresult($result);