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
816816c7
Commit
816816c7
authored
Nov 21, 2025
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Timer arred
parent
91f776b8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
38 deletions
+37
-38
match.html
mbetterclient/qt_player/templates/match.html
+37
-38
No files found.
mbetterclient/qt_player/templates/match.html
View file @
816816c7
...
...
@@ -885,11 +885,17 @@
];
}
// Find next match and start countdown (same as fixtures.html)
function
findNextMatchAndStartCountdown
()
{
if
(
!
fixturesData
||
fixturesData
.
length
===
0
)
{
return
;
}
// Get timer state and start countdown (same as fixtures.html)
async
function
getTimerStateAndStartCountdown
()
{
console
.
log
(
'🔍 DEBUG: getTimerStateAndStartCountdown called'
);
try
{
// Get timer state from WebChannel
const
timerStateJson
=
await
window
.
overlay
.
getTimerState
();
console
.
log
(
'🔍 DEBUG: Raw timer state JSON:'
,
timerStateJson
);
const
timerState
=
JSON
.
parse
(
timerStateJson
);
console
.
log
(
'🔍 DEBUG: Parsed timer state:'
,
timerState
);
// Clear any existing countdown
if
(
countdownInterval
)
{
...
...
@@ -897,36 +903,29 @@
countdownInterval
=
null
;
}
const
now
=
new
Date
();
let
nextMatch
=
null
;
let
earliestTime
=
null
;
// Find the match with the earliest start time that hasn't started yet
for
(
const
match
of
fixturesData
)
{
if
(
match
.
start_time
)
{
const
startTime
=
new
Date
(
match
.
start_time
);
if
(
startTime
>
now
&&
(
!
earliestTime
||
startTime
<
earliestTime
))
{
earliestTime
=
startTime
;
nextMatch
=
match
;
}
}
}
if
(
nextMatch
&&
earliestTime
)
{
nextMatchStartTime
=
earliestTime
;
if
(
timerState
.
running
&&
timerState
.
remaining_seconds
>
0
)
{
// Timer is running, show countdown
nextMatchStartTime
=
new
Date
(
Date
.
now
()
+
(
timerState
.
remaining_seconds
*
1000
));
// Show next match info
// Show next match info (generic message since we don't know which match)
const
nextMatchInfo
=
document
.
getElementById
(
'nextMatchInfo'
);
const
fighter1
=
nextMatch
.
fighter1_township
||
nextMatch
.
fighter1
||
'Fighter 1'
;
const
fighter2
=
nextMatch
.
fighter2_township
||
nextMatch
.
fighter2
||
'Fighter 2'
;
nextMatchInfo
.
textContent
=
`Next:
${
fighter1
}
vs
${
fighter2
}
`
;
nextMatchInfo
.
textContent
=
`Next match starting in:`
;
nextMatchInfo
.
style
.
display
=
'block'
;
console
.
log
(
'🔍 DEBUG: Timer countdown displayed'
);
// Start countdown
updateCountdown
();
countdownInterval
=
setInterval
(
updateCountdown
,
1000
);
console
.
log
(
'🔍 DEBUG: Countdown started with timer state'
);
}
else
{
// No upcoming matches, hide countdown
// No active timer, hide countdown
document
.
getElementById
(
'nextMatchInfo'
).
style
.
display
=
'none'
;
document
.
getElementById
(
'countdownTimer'
).
style
.
display
=
'none'
;
console
.
log
(
'🔍 DEBUG: No active timer, countdown hidden'
);
}
}
catch
(
error
)
{
console
.
log
(
'🔍 DEBUG: Failed to get timer state:'
,
error
);
// Fallback: hide countdown
document
.
getElementById
(
'nextMatchInfo'
).
style
.
display
=
'none'
;
document
.
getElementById
(
'countdownTimer'
).
style
.
display
=
'none'
;
}
...
...
@@ -1103,8 +1102,8 @@
matchContent
.
style
.
display
=
'block'
;
debugTime
(
'Match rendered and displayed'
);
//
Find next match
and start countdown
findNextMatch
AndStartCountdown
();
//
Get timer state
and start countdown
getTimerState
AndStartCountdown
();
debugTime
(
'Countdown initialization completed'
);
}
...
...
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