Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MBetterc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mbetter
MBetterc
Commits
140f1b85
Commit
140f1b85
authored
Feb 20, 2026
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix template rotation: stop rotation during match video, show results after match
parent
eda13efa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
6 deletions
+36
-6
routes.py
mbetterclient/web_dashboard/routes.py
+10
-1
overlay-controller.js
web/overlay-controller.js
+26
-5
No files found.
mbetterclient/web_dashboard/routes.py
View file @
140f1b85
...
@@ -10699,12 +10699,21 @@ def get_overlay_data():
...
@@ -10699,12 +10699,21 @@ def get_overlay_data():
if
headless_player
and
hasattr
(
headless_player
,
'overlay_data'
):
if
headless_player
and
hasattr
(
headless_player
,
'overlay_data'
):
overlay_data
=
headless_player
.
overlay_data
.
copy
()
if
headless_player
.
overlay_data
else
{}
overlay_data
=
headless_player
.
overlay_data
.
copy
()
if
headless_player
.
overlay_data
else
{}
# Add match video state for template switching
if
hasattr
(
headless_player
,
'is_playing_match_video'
):
overlay_data
[
'is_playing_match_video'
]
=
headless_player
.
is_playing_match_video
if
hasattr
(
headless_player
,
'current_match_video_filename'
):
overlay_data
[
'current_match_video_filename'
]
=
headless_player
.
current_match_video_filename
if
hasattr
(
headless_player
,
'current_match_id'
):
overlay_data
[
'current_match_id'
]
=
headless_player
.
current_match_id
# Add some default data if not available
# Add some default data if not available
if
not
overlay_data
:
if
not
overlay_data
:
overlay_data
=
{
overlay_data
=
{
'title'
:
'Townships Combat League'
,
'title'
:
'Townships Combat League'
,
'subtitle'
:
'Live Stream'
,
'subtitle'
:
'Live Stream'
,
'stream_status'
:
'live'
'stream_status'
:
'live'
,
'is_playing_match_video'
:
False
}
}
return
jsonify
(
overlay_data
)
return
jsonify
(
overlay_data
)
...
...
web/overlay-controller.js
View file @
140f1b85
...
@@ -564,19 +564,40 @@ class WebOverlayController {
...
@@ -564,19 +564,40 @@ class WebOverlayController {
if
(
response
)
{
if
(
response
)
{
const
hasChanges
=
JSON
.
stringify
(
this
.
overlayData
)
!==
JSON
.
stringify
(
response
);
const
hasChanges
=
JSON
.
stringify
(
this
.
overlayData
)
!==
JSON
.
stringify
(
response
);
const
wasPlayingMatchVideo
=
this
.
overlayData
.
is_playing_match_video
;
const
isNowPlayingMatchVideo
=
response
.
is_playing_match_video
;
this
.
overlayData
=
response
;
this
.
overlayData
=
response
;
// Handle match video state changes
if
(
isNowPlayingMatchVideo
&&
!
wasPlayingMatchVideo
)
{
// Match video just started - stop rotation and load match_video template
console
.
log
(
'[OverlayController] Match video started - stopping template rotation'
);
this
.
stopTemplateRotation
();
this
.
loadTemplate
(
'match_video'
);
}
else
if
(
!
isNowPlayingMatchVideo
&&
wasPlayingMatchVideo
)
{
// Match video just ended - restart rotation with results template first
console
.
log
(
'[OverlayController] Match video ended - restarting template rotation with results'
);
this
.
loadTemplate
(
'results'
);
// Restart rotation after a delay
setTimeout
(()
=>
{
this
.
startTemplateRotation
();
},
5000
);
// Show results for 5 seconds before resuming rotation
}
if
(
hasChanges
)
{
if
(
hasChanges
)
{
this
.
sendMessageToOverlay
(
'dataUpdated'
,
response
);
this
.
sendMessageToOverlay
(
'dataUpdated'
,
response
);
}
}
}
}
// Also fetch timer state on each poll
// Also fetch timer state on each poll (only if not playing match video)
if
(
!
this
.
overlayData
.
is_playing_match_video
)
{
const
timerState
=
await
this
.
fetchTimerState
();
const
timerState
=
await
this
.
fetchTimerState
();
if
(
timerState
&&
(
timerState
.
running
||
this
.
timerState
.
running
))
{
if
(
timerState
&&
(
timerState
.
running
||
this
.
timerState
.
running
))
{
// Send timer update if timer is running or was running
// Send timer update if timer is running or was running
this
.
sendMessageToOverlay
(
'timerUpdate'
,
timerState
);
this
.
sendMessageToOverlay
(
'timerUpdate'
,
timerState
);
}
}
}
return
response
;
return
response
;
}
catch
(
error
)
{
}
catch
(
error
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment