mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
Fix issues related to file list display and torrent registration (#1028)
Bencoding libraries properties changed in the new version
This commit is contained in:
parent
5005474b1a
commit
5d872e3555
4 changed files with 24 additions and 19 deletions
|
@ -32,14 +32,12 @@ if (!file_exists($filename) || !$file_contents = file_get_contents($filename)) {
|
|||
}
|
||||
}
|
||||
|
||||
if (!$tor = \Arokettu\Bencode\Bencode::decode($file_contents)) {
|
||||
if (!$tor = \Arokettu\Bencode\Bencode::decode($file_contents, dictType: \Arokettu\Bencode\Bencode\Collection::ARRAY)) {
|
||||
return $lang['TORFILE_INVALID'];
|
||||
}
|
||||
|
||||
$torrent = new TorrentPier\Legacy\TorrentFileList($tor);
|
||||
if (($tor['info']['meta version'] ?? null) == 2) {
|
||||
$tor_filelist = $torrent->fileTreeList($tor['info']['file tree'], $tor['info']['name'] ?? ''); // v2
|
||||
} else {
|
||||
$tor_filelist = $torrent->get_filelist(); // v1
|
||||
}
|
||||
|
||||
$tor_filelist = $torrent->get_filelist();
|
||||
|
||||
$this->response['html'] = $tor_filelist;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue