From e1fd2f939471e79b991c5c3dab5e3c624ca13a50 Mon Sep 17 00:00:00 2001 From: 1hitsong <3330318+1hitsong@users.noreply.github.com> Date: Thu, 12 Dec 2024 14:20:51 -0500 Subject: [PATCH 1/4] Only perform lookup once --- source/utils/misc.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/utils/misc.bs b/source/utils/misc.bs index ded2422e0..5d4a1f899 100644 --- a/source/utils/misc.bs +++ b/source/utils/misc.bs @@ -336,10 +336,10 @@ function isChainValid(root as dynamic, propertyPath as string) as boolean if properties.count() = 0 then return true if properties[0] = "" then return true - if not isValid(rootPath.LookupCI(properties[0])) then return false - rootPath = rootPath.LookupCI(properties[0]) + if not isValid(rootPath) then return false + properties.shift() if properties.count() <> 0 From e074c4b0e6eb7673f4a8410c08d7d78bafdd9440 Mon Sep 17 00:00:00 2001 From: Jimi Date: Sun, 15 Dec 2024 08:42:33 -0700 Subject: [PATCH 2/4] Back button overloading --- components/home/Home.bs | 16 ++++++++++++++++ source/Main.bs | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/components/home/Home.bs b/components/home/Home.bs index 8ed41c15c..f03c0c3ba 100644 --- a/components/home/Home.bs +++ b/components/home/Home.bs @@ -1,6 +1,7 @@ import "pkg:/source/api/baserequest.bs" import "pkg:/source/api/Image.bs" import "pkg:/source/enums/ColorPalette.bs" +import "pkg:/source/enums/KeyCode.bs" import "pkg:/source/utils/config.bs" import "pkg:/source/utils/deviceCapabilities.bs" import "pkg:/source/utils/misc.bs" @@ -87,3 +88,18 @@ sub postFinished() m.postTask.unobserveField("responseCode") m.postTask.callFunc("empty") end sub + +' Special handling for key presses on the home screen. +function onKeyEvent(key as string, press as boolean) as boolean + if not press then return false + + ' If the user hit back and is not on the first item of the row, + ' assume they want to go to the first item of the row. + ' Otherwise, they are exiting the app. + if key = KeyCode.Back and m.homeRows.currFocusColumn > 0 + m.homeRows.jumpToRowItem = [m.homeRows.currFocusRow, 0] + return true + end if + + return false +end function diff --git a/source/Main.bs b/source/Main.bs index aae7f08af..dc27d57d3 100644 --- a/source/Main.bs +++ b/source/Main.bs @@ -87,7 +87,7 @@ sub Main (args as dynamic) as void msg = wait(0, m.port) if type(msg) = "roSGScreenEvent" and msg.isScreenClosed() - print "CLOSING SCREEN" + print "SCREEN CLOSED" return end if From 8a9ac75026ca27e8c379214d564a28d744c1570a Mon Sep 17 00:00:00 2001 From: 1hitsong <3330318+1hitsong@users.noreply.github.com> Date: Mon, 16 Dec 2024 09:17:27 -0500 Subject: [PATCH 3/4] Update what's new content --- source/static/whatsNew/1.1.3.json | 6 ------ source/static/whatsNew/1.1.4.json | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 source/static/whatsNew/1.1.3.json create mode 100644 source/static/whatsNew/1.1.4.json diff --git a/source/static/whatsNew/1.1.3.json b/source/static/whatsNew/1.1.3.json deleted file mode 100644 index 461d032f0..000000000 --- a/source/static/whatsNew/1.1.3.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "description": "Fix crash on home screen", - "author": "1hitsong" - } -] \ No newline at end of file diff --git a/source/static/whatsNew/1.1.4.json b/source/static/whatsNew/1.1.4.json new file mode 100644 index 000000000..8bfca6a00 --- /dev/null +++ b/source/static/whatsNew/1.1.4.json @@ -0,0 +1,6 @@ +[ + { + "description": "Pressing back on home screen focuses 1st item in row, or exits channel if already there", + "author": "jimdogx" + } +] \ No newline at end of file From b74ab36ee9a0ce70fb76d673074134fc5ed55528 Mon Sep 17 00:00:00 2001 From: 1hitsong <3330318+1hitsong@users.noreply.github.com> Date: Wed, 18 Dec 2024 18:57:31 -0500 Subject: [PATCH 4/4] Fix possible crash if music album doesn't have an image --- source/api/Items.bs | 12 ++++++++---- source/static/whatsNew/1.1.4.json | 4 ++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/source/api/Items.bs b/source/api/Items.bs index 5e58ed727..8e695d742 100644 --- a/source/api/Items.bs +++ b/source/api/Items.bs @@ -283,10 +283,14 @@ function MusicAlbumList(id as string) tmp.RunTimeTicks = item.LookupCI("RunTimeTicks") tmp.shortdescriptionline1 = item.LookupCI("name") - tmp.HDGRIDPOSTERURL = tmp.image.url - tmp.hdposterurl = tmp.image.url - tmp.SDGRIDPOSTERURL = tmp.image.url - tmp.sdposterurl = tmp.image.url + + if isChainValid(tmp, "image.url") + tmp.HDGRIDPOSTERURL = tmp.image.url + tmp.hdposterurl = tmp.image.url + tmp.SDGRIDPOSTERURL = tmp.image.url + tmp.sdposterurl = tmp.image.url + end if + results.push(tmp) end for diff --git a/source/static/whatsNew/1.1.4.json b/source/static/whatsNew/1.1.4.json index 8bfca6a00..f2cea07b7 100644 --- a/source/static/whatsNew/1.1.4.json +++ b/source/static/whatsNew/1.1.4.json @@ -2,5 +2,9 @@ { "description": "Pressing back on home screen focuses 1st item in row, or exits channel if already there", "author": "jimdogx" + }, + { + "description": "Fix possible crash if music album doesn't have an image", + "author": "1hitsong" } ] \ No newline at end of file