From df4807e73d34acf7807b389c9af1f7e3f1c416e6 Mon Sep 17 00:00:00 2001 From: Neil Burrows Date: Sun, 4 Apr 2021 11:57:28 +0100 Subject: [PATCH 1/5] Display LiveTV Program start Dates in local timezone --- components/liveTv/ProgramDetails.brs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/components/liveTv/ProgramDetails.brs b/components/liveTv/ProgramDetails.brs index b2dd03d7..99d71e3b 100644 --- a/components/liveTv/ProgramDetails.brs +++ b/components/liveTv/ProgramDetails.brs @@ -115,23 +115,28 @@ sub programUpdated() day = getRelativeDayName(startDate) + ' Get Start Date in local timezone for display to user + localStartDate = createObject("roDateTime") + localStartDate.FromISO8601String(prog.StartDate) + localStartDate.ToLocalTime() + if startDate.AsSeconds() < now.AsSeconds() and endDate.AsSeconds() > now.AsSeconds() then if day = "today" then - m.broadcastDetails.text = tr("Started at") + " " + formatTime(startDate) + m.broadcastDetails.text = tr("Started at") + " " + formatTime(localStartDate) else - m.broadcastDetails.text = tr("Started") + " " + tr(day) + ", " + formatTime(startDate) + m.broadcastDetails.text = tr("Started") + " " + tr(day) + ", " + formatTime(localStartDate) end if else if startDate.AsSeconds() > now.AsSeconds() if day = "today" then - m.broadcastDetails.text = tr("Starts at") + " " + formatTime(startDate) + m.broadcastDetails.text = tr("Starts at") + " " + formatTime(localStartDate) else - m.broadcastDetails.text = tr("Starts") + " " + tr(day) + ", " + formatTime(startDate) + m.broadcastDetails.text = tr("Starts") + " " + tr(day) + ", " + formatTime(localStartDate) end if else if day = "today" then - m.broadcastDetails.text = tr("Ended at") + " " + formatTime(endDate) + m.broadcastDetails.text = tr("Ended at") + " " + formatTime(localStartDate) else - m.broadcastDetails.text = tr("Ended") + " " + tr(day) + ", " + formatTime(endDate) + m.broadcastDetails.text = tr("Ended") + " " + tr(day) + ", " + formatTime(localStartDate) end if end if From b3036134a9eb4558c4b0c3881bf0b118f0c62ebd Mon Sep 17 00:00:00 2001 From: Neil Burrows Date: Sun, 4 Apr 2021 12:12:48 +0100 Subject: [PATCH 2/5] Make checks for http and https case insensitive --- source/ShowScenes.brs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/ShowScenes.brs b/source/ShowScenes.brs index d0622dc9..5667e64b 100644 --- a/source/ShowScenes.brs +++ b/source/ShowScenes.brs @@ -34,11 +34,11 @@ function CreateServerGroup() if node = "submit" 'Append default ports maxSlashes = 0 - if left(server_hostname.value,8) = "https://" or left(server_hostname.value,7) = "http://" then maxSlashes = 2 + if left(lcase(server_hostname.value),8) = "https://" or left(lcase(server_hostname.value),7) = "http://" then maxSlashes = 2 'Check to make sure entry has no extra slashes before adding default ports. if Instr(0, server_hostname.value, "/") = maxSlashes then if server_hostname.value.len() > 5 and mid(server_hostname.value, server_hostname.value.len()-4,1) <> ":" and mid(server_hostname.value, server_hostname.value.len()-5,1) <> ":" then - if left(server_hostname.value ,5) = "https" then + if left(lcase(server_hostname.value) ,5) = "https" then server_hostname.value = server_hostname.value + ":8920" else server_hostname.value = server_hostname.value + ":8096" @@ -46,12 +46,12 @@ function CreateServerGroup() end if end if 'Append http:// to server - if left(server_hostname.value,4) <> "http" then server_hostname.value = "http://" + server_hostname.value + if left(lcase(server_hostname.value),4) <> "http" then server_hostname.value = "http://" + server_hostname.value 'If this is a different server from what we know, reset username/password setting if get_setting("server") <> server_hostname.value then set_setting("username", "") set_setting("password", "") - endif + end if set_setting("server", server_hostname.value) if ServerInfo() = invalid then ' Maybe don't unset setting, but offer as a prompt From 666fe2cf38ef338fdd46c260b08dd19e2e5c47b3 Mon Sep 17 00:00:00 2001 From: Neil Burrows Date: Sun, 4 Apr 2021 14:41:44 +0100 Subject: [PATCH 3/5] Improve server connection feedback --- components/config/ConfigScene.xml | 4 ++- source/Main.brs | 16 +++++++++- source/ShowScenes.brs | 24 ++++++++++++++- source/api/userauth.brs | 50 +++++++++++++++++++++++++++++-- 4 files changed, 89 insertions(+), 5 deletions(-) diff --git a/components/config/ConfigScene.xml b/components/config/ConfigScene.xml index 31836cd3..ff409711 100644 --- a/components/config/ConfigScene.xml +++ b/components/config/ConfigScene.xml @@ -19,8 +19,10 @@ translation="[150, 450]" />