fixed tvcom http vs https

This commit is contained in:
Radek Davidek 2025-11-02 19:34:30 +01:00
parent 0fedb4e6b4
commit 5137ddd44e
2 changed files with 12 additions and 2 deletions

View File

@ -24,7 +24,7 @@ import lombok.extern.log4j.Log4j2;
@Log4j2 @Log4j2
public class BasketballServer { 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 { public static void main(String[] args) throws Exception {
log.info("Starting Basketball Server..."); log.info("Starting Basketball Server...");

View File

@ -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; const liveUrl = match.links.live && match.links.live.url;
tr.innerHTML = ` tr.innerHTML = `