From 7f4cc9d3b9a5b87100f710cc60f636d6e7d5a34e Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Mon, 23 Jun 2025 21:49:53 +0300 Subject: [PATCH] fix(filelist): `Undefined property: FileTree::$length` when v2 torrent only (#2004) --- filelist.php | 15 +-------------- styles/templates/default/filelist.tpl | 24 ------------------------ 2 files changed, 1 insertion(+), 38 deletions(-) diff --git a/filelist.php b/filelist.php index 81a241d20..b07e319c6 100644 --- a/filelist.php +++ b/filelist.php @@ -82,7 +82,7 @@ if (IS_GUEST && $torrent->isPrivate()) { // Get torrent files $files = $torrent->$t_version_field()->$t_files_field(); -if ($meta_v1 && $meta_v2) { +if ($meta_v2) { $files = new \RecursiveIteratorIterator($files); // Flatten the list } @@ -102,19 +102,6 @@ foreach ($files as $file) { $torrent_name = !empty($t_name = $torrent->getName()) ? str_short(htmlCHR($t_name), 200) : $lang['UNKNOWN']; $torrent_size = humn_size($row['size'], 2); -// Get announcers list -$announcers_list = $torrent->getAnnounceList()->toArray(); -$announcers_count = 0; -foreach ($announcers_list as $announcer) { - $announcers_count++; - $row_class = ($announcers_count % 2) ? 'row1' : 'row2'; - $template->assign_block_vars('announcers', [ - 'ROW_NUMBER' => $announcers_count, - 'ROW_CLASS' => $row_class, - 'ANNOUNCER' => $announcer[0] - ]); -} - // Output page $template->assign_vars([ 'PAGE_TITLE' => "$torrent_name (" . $torrent_size . ")", diff --git a/styles/templates/default/filelist.tpl b/styles/templates/default/filelist.tpl index 9e6bc4eb4..149a98acc 100644 --- a/styles/templates/default/filelist.tpl +++ b/styles/templates/default/filelist.tpl @@ -6,30 +6,6 @@
-

{L_BT_FLIST_ANNOUNCERS_LIST}

- - - - - - - - - - - - - - - - - - - - -
#{L_BT_FLIST_ANNOUNCERS}
{announcers.ROW_NUMBER}{announcers.ANNOUNCER}
{L_BT_FLIST_ANNOUNCERS_NOTICE}
-
-

{L_BT_FLIST}