diff --git a/nexus/Torrent/BdInfoExtra.php b/nexus/Torrent/BdInfoExtra.php index 2f1e45f2..5385e0ad 100644 --- a/nexus/Torrent/BdInfoExtra.php +++ b/nexus/Torrent/BdInfoExtra.php @@ -315,19 +315,19 @@ class BdInfoExtra $video['aspect_ratio'] = $ratioMatches[1]; } } else { - // 隐藏视频流,检查是否包含Dolby Vision信息 - if (strpos($matches[4], 'Dolby Vision') !== false) { - // 将Dolby Vision信息添加到第一个视频流描述中 - if (isset($video[0]['description'])) { - $video[0]['description'] .= ' / ' . trim($matches[4]); - } - } + // 隐藏视频流 - 也作为独立的视频流处理,但标记为隐藏 + $video[] = [ + 'codec' => trim($matches[2]), + 'bitrate' => trim($matches[3]) . ' kbps', + 'description' => trim($matches[4]), + 'hidden' => true + ]; } } } /** - * 提取非英文内容 + * 提取字幕和音轨描述中的非英文内容 */ private function extractNonEnglishContent(string $text): array { @@ -336,6 +336,8 @@ class BdInfoExtra // 提取所有非英文字符的内容 if (preg_match_all('/[^\x{0000}-\x{007F}]+/u', $text, $matches)) { foreach ($matches[0] as $match) { + // 去除制表符和括号 + $match = preg_replace('/[\s\t\n\r()()【】\[\]]+/u', '', $match); $match = trim($match); if (!empty($match)) { $result['non_english_content'][] = $match; @@ -478,9 +480,9 @@ class BdInfoExtra { $profiles = []; - // 检查所有视频流 + // 检查所有视频流,跳过隐藏视频流 foreach ($this->bdInfoArr['video'] as $key => $video) { - if (is_array($video) && isset($video['description'])) { + if (is_array($video) && isset($video['description']) && !isset($video['hidden'])) { $description = $video['description']; if (preg_match('/([^\/]*?(?:profile|high|level|main)[^\/]*?)(?:\s*\/|$)/i', $description, $matches)) { $profiles[] = trim($matches[1]); @@ -612,27 +614,52 @@ class BdInfoExtra */ public function getHDRFormat(): string { - // 从第一个视频流获取HDR信息 - $firstVideo = $this->bdInfoArr['video'][0] ?? null; - $description = $firstVideo['description'] ?? ''; - $hdrFormats = []; + // 从所有视频流获取HDR信息 + $hdrTypes = []; + $bitDepths = []; + $nits = []; - // 从VIDEO描述中提取HDR格式 - if (preg_match('/\b(HDR10|HLG|Dolby Vision)\b/i', $description, $matches)) { - $hdrFormats[] = $matches[1]; + foreach ($this->bdInfoArr['video'] as $video) { + $description = $video['description'] ?? ''; + + // 从VIDEO描述中提取HDR格式 + if (preg_match('/\b(HDR10\+|HDR10|HDR|HLG|Dolby Vision)(?:\s|\/|$)/i', $description, $matches)) { + $hdrTypes[] = $matches[1]; + } + + // 检查比特深度 + if (preg_match('/(\d+)\s+bits/', $description, $matches)) { + $bitDepths[] = $matches[1] . ' bits'; + } + + // 检查亮度 + if (preg_match('/(\d+)nits/', $description, $matches)) { + $nits[] = $matches[1] . 'nits'; + } } - // 检查比特深度 - if (preg_match('/(\d+)\s+bits/', $description, $matches)) { - $hdrFormats[] = $matches[1] . ' bits'; + // 去重并构建结果 + $result = []; + + // HDR格式 + $hdrTypes = array_unique($hdrTypes); + if (!empty($hdrTypes)) { + $result[] = implode(' / ', $hdrTypes); } - // 检查亮度 - if (preg_match('/(\d+)nits/', $description, $matches)) { - $hdrFormats[] = $matches[1] . 'nits'; + // 比特深度 + $bitDepths = array_unique($bitDepths); + if (!empty($bitDepths)) { + $result[] = implode(' / ', $bitDepths); + } + + // 亮度 + $nits = array_unique($nits); + if (!empty($nits)) { + $result[] = implode(' / ', $nits); } - return implode(' / ', $hdrFormats); + return implode(' / ', $result); } /** diff --git a/public/comment.php b/public/comment.php index fc5a37b7..17f2f1a6 100644 --- a/public/comment.php +++ b/public/comment.php @@ -117,10 +117,10 @@ if ($action == "add") $commentid = intval($_GET["cid"] ?? 0); int_check($commentid,true); - $res2 = sql_query("SELECT comments.text, users.username FROM comments JOIN users ON comments.user = users.id WHERE comments.id=$commentid") or sqlerr(__FILE__, __LINE__); + $res2 = sql_query("SELECT comments.text, users.username FROM comments LEFT JOIN users ON comments.user = users.id WHERE comments.id=$commentid") or sqlerr(__FILE__, __LINE__); if (mysql_num_rows($res2) != 1) - stderr($lang_forums['std_error'], $lang_forums['std_no_comment_id']); + stderr($lang_comment['std_error'], $lang_comment['std_no_comment_id']); $arr2 = mysql_fetch_assoc($res2); } diff --git a/resources/lang/en/nexus.php b/resources/lang/en/nexus.php index aa8f0575..2115c2cd 100644 --- a/resources/lang/en/nexus.php +++ b/resources/lang/en/nexus.php @@ -7,6 +7,7 @@ return [ 'user_not_exists' => '(orphaned)', 'time_units' => [ 'week' => 'weeks', + 'hour' => 'hours', ], 'select_all' => 'Select all', 'unselect_all' => 'Unselect all', diff --git a/resources/lang/zh_CN/torrent.php b/resources/lang/zh_CN/torrent.php index a7a209af..cb1d151b 100644 --- a/resources/lang/zh_CN/torrent.php +++ b/resources/lang/zh_CN/torrent.php @@ -96,7 +96,7 @@ return [ 'technicalinfo_frame_rate' => '帧率', 'technicalinfo_profile' => '档次', 'technicalinfo_format' => '格式', - 'technicalinfo_extras' => '附加内容', + 'technicalinfo_extras' => '附加信息', 'technicalinfo_ref_frames' => '参考帧', 'technicalinfo_audio' => '音轨 #', 'technicalinfo_subtitles' => '字幕 #', diff --git a/resources/lang/zh_TW/nexus.php b/resources/lang/zh_TW/nexus.php index e7020b8f..b43d1407 100644 --- a/resources/lang/zh_TW/nexus.php +++ b/resources/lang/zh_TW/nexus.php @@ -7,6 +7,7 @@ return [ 'user_not_exists' => '(無此帳戶)', 'time_units' => [ 'week' => '周', + 'hour' => '小時', ], 'select_all' => '全選', 'unselect_all' => '全不選', diff --git a/resources/lang/zh_TW/torrent.php b/resources/lang/zh_TW/torrent.php index c82664c5..62f35797 100644 --- a/resources/lang/zh_TW/torrent.php +++ b/resources/lang/zh_TW/torrent.php @@ -96,7 +96,7 @@ return [ 'technicalinfo_frame_rate' => '幀率', 'technicalinfo_profile' => '檔次', 'technicalinfo_format' => '格式', - 'technicalinfo_extras' => '附加內容', + 'technicalinfo_extras' => '附加資訊', 'technicalinfo_ref_frames' => '參考幀', 'technicalinfo_audio' => '音軌 #', 'technicalinfo_subtitles' => '字幕 #',