HMS

Home Media Server for Roku Players
git clone https://www.brianlane.com/git/HMS
Log | Files | Refs | README | LICENSE

commit 33b386a6beb12068a62cc705b4423a96f81870cb
parent 32962fc0e8d06bd83117b737f248b9f95b09fb5d
Author: Brian C. Lane <bcl@brianlane.com>
Date:   Tue, 26 Aug 2025 11:37:32 -0700

keystore: Strip off value= from string if it exists

For some reason I store the values as "value="+value in the keystore.
The right thing to do would be to stop doing this, but in order to
maintain compatibility with existing keystores it will now strip off
'value=' from the string.

Also, I think the older brightscript .toint() stripped off non-digits
before doing the conversion, which the current implementation does not
do.

Fixes #15

Diffstat:
MHMS/components/MainScene.brs | 1+
MHMS/source/keystore.brs | 5++++-
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/HMS/components/MainScene.brs b/HMS/components/MainScene.brs @@ -260,6 +260,7 @@ sub StartPlayback() ' Was there a result? if m.keystoreTask.value <> "" + print "Seeking to "; m.keystoreTask.value.ToInt() m.video.seek = m.keystoreTask.value.ToInt() end if ' Play the selected video diff --git a/HMS/source/keystore.brs b/HMS/source/keystore.brs @@ -15,11 +15,14 @@ Function getKeyValue(url As String, key As String) As String elseif result.error and result.response = 404 then return "" end if - return result.str + + ' The keyserver returns 'value=XXXX', strip off the value= if present + return result.str.Replace("value=","") End Function ' *********************************** ' * Set a value for a key +' For historical reasons the actual value stored includes the string 'value=' at the start. ' *********************************** Function setKeyValue(url As String, key As String, value As String) result = postHTMLWithTimeout(url+"/keystore/"+key, "value="+value, 60)