Skip to content

Commit

Permalink
Merge branch 'master' into viv-fix-race-condition
Browse files Browse the repository at this point in the history
  • Loading branch information
1hitsong authored Dec 19, 2024
2 parents 2243020 + b74ab36 commit 0688a74
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 13 deletions.
16 changes: 16 additions & 0 deletions components/home/Home.bs
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion source/Main.bs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 8 additions & 4 deletions source/api/Items.bs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 0 additions & 6 deletions source/static/whatsNew/1.1.3.json

This file was deleted.

10 changes: 10 additions & 0 deletions source/static/whatsNew/1.1.4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"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"
}
]
4 changes: 2 additions & 2 deletions source/utils/misc.bs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0688a74

Please sign in to comment.