mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 22:03:49 -07:00
feat: Add option to use original torrent filenames for downloads
This commit is contained in:
parent
e1337ef5bc
commit
b9d28041bb
2 changed files with 10 additions and 4 deletions
|
@ -747,7 +747,8 @@ $bb_cfg['tracker'] = [
|
||||||
'hybrid_stat_protocol' => 1, // For hybrid torrents there are two identical requests sent by clients, for counting stats we gotta choose one, you can change this to '2' in future, when v1 protocol is outdated
|
'hybrid_stat_protocol' => 1, // For hybrid torrents there are two identical requests sent by clients, for counting stats we gotta choose one, you can change this to '2' in future, when v1 protocol is outdated
|
||||||
'disabled_v1_torrents' => false, // disallow registration of v1-only torrents, for future implementations where client will use v2 only and there won't be need for v1, thus relieving tracker
|
'disabled_v1_torrents' => false, // disallow registration of v1-only torrents, for future implementations where client will use v2 only and there won't be need for v1, thus relieving tracker
|
||||||
'disabled_v2_torrents' => false, // disallow registration of v2-only torrents
|
'disabled_v2_torrents' => false, // disallow registration of v2-only torrents
|
||||||
'use_old_torrent_name_format' => false, // when enabled, the names of torrent files will have the classic format: [yoursite.com].txxx.torrent
|
'use_real_filename' => false, // Use original torrent filename for downloads. If disabled, filename will be generated automatically
|
||||||
|
'use_old_torrent_name_format' => false, // Use classic filename format '[yoursite.com].txxx.torrent'. Only works when use_real_filename is disabled
|
||||||
];
|
];
|
||||||
|
|
||||||
// Ratio settings
|
// Ratio settings
|
||||||
|
|
|
@ -644,10 +644,15 @@ class Torrent
|
||||||
// Send torrent
|
// Send torrent
|
||||||
$output = Bencode::encode($tor);
|
$output = Bencode::encode($tor);
|
||||||
|
|
||||||
if ($bb_cfg['tracker']['use_old_torrent_name_format']) {
|
$real_filename = clean_filename(basename($attachment['real_filename']));
|
||||||
$dl_fname = '[' . $bb_cfg['server_name'] . '].t' . $topic_id . '.' . TORRENT_EXT;
|
if ($bb_cfg['tracker']['use_real_filename']) {
|
||||||
|
$dl_fname = $real_filename;
|
||||||
} else {
|
} else {
|
||||||
$dl_fname = html_ent_decode($topic_title) . ' [' . $bb_cfg['server_name'] . '-' . $topic_id . ']' . '.' . TORRENT_EXT;
|
if ($bb_cfg['tracker']['use_old_torrent_name_format']) {
|
||||||
|
$dl_fname = '[' . $bb_cfg['server_name'] . '].t' . $topic_id . '.' . TORRENT_EXT;
|
||||||
|
} else {
|
||||||
|
$dl_fname = html_ent_decode($topic_title) . ' [' . $bb_cfg['server_name'] . '-' . $topic_id . ']' . '.' . TORRENT_EXT;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($_COOKIE['explain'])) {
|
if (!empty($_COOKIE['explain'])) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue