Skip to content

Commit 1b903b2

Browse files
author
Taois
committed
feat: 完成txt直播支持
1 parent d06f2fb commit 1b903b2

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

dashboard/src/api/services/live.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,16 @@ class LiveService {
343343

344344
for (const line of lines) {
345345
if (line.includes('#genre#')) {
346-
// 分组标记
347-
currentGroupName = line.replace('#genre#', '').trim()
346+
// 分组标记 - 格式为 "分组名称,#genre#"
347+
const genreIndex = line.indexOf('#genre#')
348+
if (genreIndex > 0) {
349+
// 提取逗号前的分组名称
350+
currentGroupName = line.substring(0, genreIndex).replace(/,$/, '').trim()
351+
} else {
352+
// 兼容其他可能的格式
353+
currentGroupName = line.replace('#genre#', '').trim()
354+
}
355+
348356
if (!groups.has(currentGroupName)) {
349357
groups.set(currentGroupName, {
350358
name: currentGroupName,

0 commit comments

Comments
 (0)