diff --git a/nexus/Torrent/TechnicalInformation.php b/nexus/Torrent/TechnicalInformation.php index 688a30b9..0f6a11b7 100644 --- a/nexus/Torrent/TechnicalInformation.php +++ b/nexus/Torrent/TechnicalInformation.php @@ -149,47 +149,35 @@ class TechnicalInformation $videos = array_filter($videos); $audios = $this->getAudios(); $subtitles = $this->getSubtitles(); - //video part - $videoTable = ''; - foreach (array_chunk($videos, 2, true) as $row) { - $videoTable .= ''; - foreach ($row as $key => $value) { - $videoTable .= sprintf('', $key, $value); - } - $videoTable .= ''; - } - $videoTable .= '
%s: %s
'; - - $audioTable = ''; - $audioTable .= ''; - foreach ($audios as $key => $value) { - $audioTable .= sprintf('', $key, $value); - } - $audioTable .= ''; - $audioTable .= '
%s: %s
'; - - $subtitleTable = ''; - $subtitleTable .= ''; - foreach ($subtitles as $key => $value) { - $subtitleTable .= sprintf('', $key, $value); - } - $subtitleTable .= ''; - $subtitleTable .= '
%s: %s
'; - +// dd($videos, $audios, $subtitles); if (empty($videos) && empty($audios) && empty($subtitles)) { return ''; } - $result = ''; + + $result = '
'; if (!empty($videos)) { - $result .= sprintf('', $videoTable); + $result .= $this->buildTdTable($videos); } if (!empty($audios)) { - $result .= sprintf('', $audioTable); + $result .= $this->buildTdTable($audios); } if (!empty($subtitles)) { - $result .= sprintf('', $subtitleTable); + $result .= $this->buildTdTable($subtitles); } $result .= '
%s%s%s
'; return $result; } + + private function buildTdTable(array $parts) + { + $table = ''; + foreach ($parts as $key => $value) { + $table .= ''; + $table .= sprintf('', $key, $value); + $table .= ''; + } + $table .= '
%s: %s
'; + return sprintf('%s', $table); + } + }