Exclude padding files (#260)

* Exclude padding files

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2023-09-24 19:16:25 +07:00 committed by GitHub
parent 8852eb1b4a
commit ac402eda7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View File

@ -6,8 +6,9 @@
**Merged pull requests:** **Merged pull requests:**
- Release v2.1.5-2023.09 🎉 - 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)) - 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)) - 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)) - 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))

View File

@ -103,6 +103,11 @@ class torrent
{ {
continue; continue;
} }
// Exclude padding files [Only for hybrid torrents]
if ((isset($f['attr']) ? $f['attr'] : null) === 'p')
{
continue;
}
array_deep($f['path'], 'clean_tor_dirname'); array_deep($f['path'], 'clean_tor_dirname');
$length = isset($f['length']) ? (float) $f['length'] : 0; $length = isset($f['length']) ? (float) $f['length'] : 0;

View File

@ -320,10 +320,14 @@ function tracker_register ($attach_id, $mode = '', $tor_status = TOR_NOT_APPROVE
else if (isset($info['files']) && is_array($info['files'])) else if (isset($info['files']) && is_array($info['files']))
{ {
foreach ($info['files'] as $fn => $f) foreach ($info['files'] as $fn => $f)
{
// Exclude padding files [Only for hybrid torrents]
if ((isset($f['attr']) ? $f['attr'] : null) !== 'p')
{ {
$totallen += (float) $f['length']; $totallen += (float) $f['length'];
} }
} }
}
else else
{ {
return torrent_error_exit($lang['TORFILE_INVALID']); return torrent_error_exit($lang['TORFILE_INVALID']);