Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/core/record_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ async def check_if_live(self, recording: Recording):
recording.title = f"{recording.streamer_name} - {self._[recording.quality]}"
recording.display_title = f"[{self._['is_live']}] {recording.title}"

if self.settings.user_config["stream_start_notification_enabled"] or recording.enabled_message_push:
if self.settings.user_config["stream_start_notification_enabled"] and recording.enabled_message_push:
push_content = self._["push_content"]
begin_push_message_text = self.settings.user_config.get("custom_stream_start_content")
if begin_push_message_text:
Expand Down
16 changes: 16 additions & 0 deletions app/core/stream_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from datetime import datetime
from typing import Any

from ..messages.message_pusher import MessagePusher
from ..models.recording_status_model import RecordingStatus
from ..models.video_quality_model import VideoQuality
from ..process_manager import BackgroundService
Expand Down Expand Up @@ -264,7 +265,22 @@ async def start_ffmpeg(
else:
self.recording.recording = False
logger.success(f"Live recording completed: {record_name}")
if (self.settings.user_config["stream_end_notification_enabled"]
and self.recording.enabled_message_push):
push_content = self._["push_content_end"]
end_push_message_text = self.settings.user_config.get("custom_stream_end_content")
if end_push_message_text:
push_content = end_push_message_text

push_at = datetime.today().strftime("%Y-%m-%d %H:%M:%S")
push_content = push_content.replace("[room_name]", self.recording.streamer_name).replace(
"[time]", push_at
)
msg_title = self.settings.user_config.get("custom_notification_title").strip()
msg_title = msg_title or self._["status_notify"]

msg_manager = MessagePusher(self.settings)
self.app.page.run_task(msg_manager.push_messages, msg_title, push_content)
try:
self.recording.update({"display_title": display_title})
await self.app.record_card_manager.update_card(self.recording)
Expand Down
2 changes: 1 addition & 1 deletion app/ui/components/recording_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ async def on_segment_setting_change(e):
scheduled_recording = initial_values.get("scheduled_recording", False)
scheduled_start_time = initial_values.get("scheduled_start_time")
monitor_hours = initial_values.get("monitor_hours", 5)
message_push_enabled = initial_values.get('enabled_message_push', False)
message_push_enabled = initial_values.get('enabled_message_push', True)

async def on_scheduled_setting_change(e):
selected_value = e.control.value
Expand Down
1 change: 1 addition & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"live_room": "Live Room",
"recorded": "Recorded",
"push_content": "Live room status update: [room_name] is live, time: [time]",
"push_content_end": "Live room status update: [room_name] is live completed, time: [time]",
"status_notify": "Live room status update notification",
"STOPPED_MONITORING": "Monitoring Stopped",
"MONITORING": "Monitoring In Progress",
Expand Down
1 change: 1 addition & 0 deletions locales/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"live_room": "直播间",
"recorded": "已录制",
"push_content": "直播间状态更新:[room_name] 正在直播中,时间:[time]",
"push_content_end": "直播间状态更新:[room_name] 直播已结束,时间:[time]",
"status_notify": "直播间状态更新通知",
"platform_not_supported_tip": "暂不支持该平台录制",
"STOPPED_MONITORING": "直播间已停止监控",
Expand Down