refactor(TorrentFileList): Reduce duplication in root directory unset logic (#2027)

This commit is contained in:
Roman Kelesidis 2025-07-02 10:31:07 +03:00
commit d4d82101dd
No known key found for this signature in database
GPG key ID: D8157C4D4C4C6DB4

View file

@ -53,8 +53,10 @@ class TorrentFileList
$this->build_filelist_array();
if ($this->multiple) {
if (!empty($this->files_ary['/'])) {
$this->files_ary = $this->files_ary + $this->files_ary['/'];
if (isset($this->files_ary['/'])) {
if (!empty($this->files_ary['/'])) {
$this->files_ary = $this->files_ary + $this->files_ary['/'];
}
unset($this->files_ary['/']);
}
$filelist = $html->array2html($this->files_ary);