From 5137ddd44e4ed76b777250931589155a9ec0e363 Mon Sep 17 00:00:00 2001 From: Radek Davidek Date: Sun, 2 Nov 2025 19:34:30 +0100 Subject: [PATCH] fixed tvcom http vs https --- src/main/java/cz/kamma/czb/BasketballServer.java | 2 +- src/main/resources/index.html | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/cz/kamma/czb/BasketballServer.java b/src/main/java/cz/kamma/czb/BasketballServer.java index 6bad0bc..11e11c0 100644 --- a/src/main/java/cz/kamma/czb/BasketballServer.java +++ b/src/main/java/cz/kamma/czb/BasketballServer.java @@ -24,7 +24,7 @@ import lombok.extern.log4j.Log4j2; @Log4j2 public class BasketballServer { - private static final String VERSION = "1.0.1"; + private static final String VERSION = "1.0.2"; public static void main(String[] args) throws Exception { log.info("Starting Basketball Server..."); diff --git a/src/main/resources/index.html b/src/main/resources/index.html index 84117fc..6408cb0 100644 --- a/src/main/resources/index.html +++ b/src/main/resources/index.html @@ -247,7 +247,17 @@ function renderMatches(matches) { } } - const tvUrl = match.links.tvcom && match.links.tvcom.url; + let tvUrl = match.links.tvcom && match.links.tvcom.url; + if (tvUrl) { + if (tvUrl.startsWith('//')) { + tvUrl = 'https:' + tvUrl; + } else if (tvUrl.startsWith('http://embed')) { + tvUrl = tvUrl.replace('http://', 'https://'); + } else if (!tvUrl.startsWith('http://') && !tvUrl.startsWith('https://')) { + tvUrl = 'https://' + tvUrl; + } + } + const liveUrl = match.links.live && match.links.live.url; tr.innerHTML = `