[skip ci] Avoid double reporting error

This commit is contained in:
Brahim Hadriche committed 2025-09-04 12:23:45 -04:00
1 parent 26285535ac
commit 5fc059f700
1 file changed
+6 -2
@@ -441,6 +441,7 @@ function OnVideoPlayerStateChange() as void
m.videoPlayingSuccess = true m.videoPlayingSuccess = true
end if end if
errorReported = false
if state = "error" if state = "error"
errorInfo = m.top.errorInfo errorInfo = m.top.errorInfo
errorData = GetPlayerErrorData(content.videoId, errorInfo) errorData = GetPlayerErrorData(content.videoId, errorInfo)
@@ -448,9 +449,10 @@ function OnVideoPlayerStateChange() as void
LogErrorNoTelemetry(errorData.title, errorData.body) LogErrorNoTelemetry(errorData.title, errorData.body)
m.global.telemetry.LogEvent = { m.global.telemetry.LogEvent = {
level: "error" level: "error"
message: errorData.title + `\n` + errorData.body message: errorData.title + " " + errorData.body
fingerprint: errorData.fingerprint fingerprint: errorData.fingerprint
} }
errorReported = true
if m.videoPlayingSuccess <> true if m.videoPlayingSuccess <> true
' http for stream format, mediaerror for DASH ' http for stream format, mediaerror for DASH
@@ -500,11 +502,13 @@ function OnVideoPlayerStateChange() as void
errorData = GetPlayerErrorData(content.videoId, errorInfo) errorData = GetPlayerErrorData(content.videoId, errorInfo)
LogErrorNoTelemetry(errorData.title, errorData.body) LogErrorNoTelemetry(errorData.title, errorData.body)
if not errorReported
m.global.telemetry.LogEvent = { m.global.telemetry.LogEvent = {
level: "error" level: "error"
message: errorData.title + `\n` + errorData.body message: errorData.title + " " + errorData.body
fingerprint: errorData.fingerprint fingerprint: errorData.fingerprint
} }
end if
buttons = [Tr(Locale.Buttons.PlayNextVideo), Tr(Locale.Buttons.Cancel)] buttons = [Tr(Locale.Buttons.PlayNextVideo), Tr(Locale.Buttons.Cancel)]