Skip to content

Commit 2d9f79d

Browse files
committed
feat: add live info check error status
1 parent 2f73196 commit 2d9f79d

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

app/core/record_manager.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ async def periodic_check():
169169

170170
async def check_if_live(self, recording: Recording):
171171
"""Check if the live stream is available, fetch stream data and update is_live status."""
172+
173+
if recording.recording:
174+
return
175+
172176
if not recording.monitor_status:
173177
recording.display_title = f"[{self._['monitor_stopped']}] {recording.title}"
174178
recording.status_info = RecordingStatus.STOPPED_MONITORING
@@ -217,6 +221,7 @@ async def check_if_live(self, recording: Recording):
217221
if not stream_info or not stream_info.anchor_name:
218222
logger.error(f"Fetch stream data failed: {recording.url}")
219223
recording.is_checking = False
224+
recording.status_info = RecordingStatus.LIVE_STATUS_CHECK_ERROR
220225
return
221226

222227
if self.settings.user_config.get("remove_emojis"):
@@ -337,4 +342,4 @@ async def check_free_space(self, output_dir: str | None = None):
337342
)
338343

339344
else:
340-
self.app.recording_enabled = True
345+
self.app.recording_enabled = True

app/models/recording_status_model.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class RecordingStatus:
88
PREPARING_RECORDING = "PREPARING_RECORDING"
99
RECORDING_ERROR = "RECORDING_ERROR"
1010
NOT_RECORDING_SPACE = "NOT_RECORDING_SPACE"
11+
LIVE_STATUS_CHECK_ERROR = "LIVE_STATUS_CHECK_ERROR"
1112

1213
@classmethod
1314
def get_status(cls):

locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
"PREPARING_RECORDING": "Preparing to Start Recording",
7373
"RECORDING_ERROR": "Recording the live stream has failed",
7474
"NOT_RECORDING_SPACE": "Insufficient disk space to record",
75+
"LIVE_STATUS_CHECK_ERROR": "Live status error, check address accessibility",
7576
"not_disk_space_tip": "⚠️ Insufficient disk storage space, stop recording"
7677
},
7778
"stream_manager": {

locales/zh_CN.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
"PREPARING_RECORDING": "主播正在直播中, 准备开始录制",
7575
"RECORDING_ERROR": "直播录制失败, 等待重试",
7676
"NOT_RECORDING_SPACE": "磁盘空间不足, 无法录制",
77+
"LIVE_STATUS_CHECK_ERROR": "直播状态检测错误, 请检查地址是否可正常访问",
7778
"not_disk_space_tip": "⚠️ 磁盘存储空间不足, 停止录制"
7879
},
7980
"stream_manager": {

0 commit comments

Comments
 (0)