diff --git a/CHANGELOG.md b/CHANGELOG.md index 82f30b71..86c1820f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,9 @@ **Merged pull requests:** - Release v2.1.5-2023.09 🎉 +- Exclude padding files [\#260](https://github.com/torrentpier/torrentpier-lts/pull/260) ([belomaxorka](https://github.com/belomaxorka), [kovalensky](https://github.com/kovalensky)) - Added missing translation in admin_ug_auth [\#254](https://github.com/torrentpier/torrentpier-lts/pull/254) ([belomaxorka](https://github.com/belomaxorka)) -- Support for IDN domains [\#252](https://github.com/torrentpier/torrentpier-lts/pull/252) ([belomaxorka](https://github.com/belomaxorka)) +- Support for IDN domains [\#252](https://github.com/torrentpier/torrentpier-lts/pull/252) ([belomaxorka](https://github.com/belomaxorka), [kovalensky](https://github.com/kovalensky)) - Fixed cache directory auto-creating with SQLite [\#247](https://github.com/torrentpier/torrentpier-lts/pull/247) ([belomaxorka](https://github.com/belomaxorka)) - Minor improvements [\#245](https://github.com/torrentpier/torrentpier-lts/pull/245), [\#246](https://github.com/torrentpier/torrentpier-lts/pull/246), [\#248](https://github.com/torrentpier/torrentpier-lts/pull/248), [\#249](https://github.com/torrentpier/torrentpier-lts/pull/249), [\#250](https://github.com/torrentpier/torrentpier-lts/pull/250), [\#251](https://github.com/torrentpier/torrentpier-lts/pull/251), [\#253](https://github.com/torrentpier/torrentpier-lts/pull/253), [\#255](https://github.com/torrentpier/torrentpier-lts/pull/255), [\#256](https://github.com/torrentpier/torrentpier-lts/pull/256), [\#257](https://github.com/torrentpier/torrentpier-lts/pull/257), [\#258](https://github.com/torrentpier/torrentpier-lts/pull/258), [\#259](https://github.com/torrentpier/torrentpier-lts/pull/259) ([belomaxorka](https://github.com/belomaxorka)) diff --git a/library/ajax/view_torrent.php b/library/ajax/view_torrent.php index 0a045021..a9adf48e 100644 --- a/library/ajax/view_torrent.php +++ b/library/ajax/view_torrent.php @@ -103,6 +103,11 @@ class torrent { continue; } + // Exclude padding files [Only for hybrid torrents] + if ((isset($f['attr']) ? $f['attr'] : null) === 'p') + { + continue; + } array_deep($f['path'], 'clean_tor_dirname'); $length = isset($f['length']) ? (float) $f['length'] : 0; diff --git a/library/includes/functions_torrent.php b/library/includes/functions_torrent.php index 7c391262..bd436ee5 100644 --- a/library/includes/functions_torrent.php +++ b/library/includes/functions_torrent.php @@ -321,7 +321,11 @@ function tracker_register ($attach_id, $mode = '', $tor_status = TOR_NOT_APPROVE { foreach ($info['files'] as $fn => $f) { - $totallen += (float) $f['length']; + // Exclude padding files [Only for hybrid torrents] + if ((isset($f['attr']) ? $f['attr'] : null) !== 'p') + { + $totallen += (float) $f['length']; + } } } else