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('| %s: %s | ', $key, $value);
- }
- $videoTable .= '
';
- }
- $videoTable .= '
';
-
- $audioTable = '';
- $audioTable .= '';
- foreach ($audios as $key => $value) {
- $audioTable .= sprintf('| %s: %s | ', $key, $value);
- }
- $audioTable .= '
';
- $audioTable .= '
';
-
- $subtitleTable = '';
- $subtitleTable .= '';
- foreach ($subtitles as $key => $value) {
- $subtitleTable .= sprintf('| %s: %s | ', $key, $value);
- }
- $subtitleTable .= '
';
- $subtitleTable .= '
';
-
+// dd($videos, $audios, $subtitles);
if (empty($videos) && empty($audios) && empty($subtitles)) {
return '';
}
- $result = '';
+
+ $result = '';
if (!empty($videos)) {
- $result .= sprintf('| %s | ', $videoTable);
+ $result .= $this->buildTdTable($videos);
}
if (!empty($audios)) {
- $result .= sprintf('%s | ', $audioTable);
+ $result .= $this->buildTdTable($audios);
}
if (!empty($subtitles)) {
- $result .= sprintf('%s | ', $subtitleTable);
+ $result .= $this->buildTdTable($subtitles);
}
$result .= '
';
return $result;
}
+
+ private function buildTdTable(array $parts)
+ {
+ $table = '';
+ foreach ($parts as $key => $value) {
+ $table .= '';
+ $table .= sprintf('| %s: %s | ', $key, $value);
+ $table .= '
';
+ }
+ $table .= '
';
+ return sprintf('%s | ', $table);
+ }
+
}