Skip to content

Commit

Permalink
Merge pull request #1952 from cewert/fix-movie-refresh-crash2
Browse files Browse the repository at this point in the history
  • Loading branch information
cewert authored Oct 2, 2024
2 parents c3aebee + 4ad317a commit f36f975
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions source/Main.bs
Original file line number Diff line number Diff line change
Expand Up @@ -248,16 +248,18 @@ sub Main (args as dynamic) as void
currentScene = m.global.sceneManager.callFunc("getActiveScene")

if isValid(currentScene) and isValid(currentScene.itemContent) and isValid(currentScene.itemContent.id)
' Refresh movie detail data
currentScene.itemContent.json = api.users.GetItem(m.global.session.user.id, currentScene.itemContent.id)
movieMetaData = ItemMetaData(currentScene.itemContent.id)

if isValid(movieMetaData)
' Redraw movie poster
currentScene.newPosterImageURI = movieMetaData.posterURL

data = api.users.GetItem(m.global.session.user.id, currentScene.itemContent.id)
if isValid(data)
currentScene.itemContent.json = data
' Set updated starting point for the queue item
m.global.queueManager.callFunc("setTopStartingPoint", currentScene.itemContent.json.UserData.PlaybackPositionTicks)
m.global.queueManager.callFunc("setTopStartingPoint", data.UserData.PlaybackPositionTicks)

' Refresh movie detail data
movieMetaData = ItemMetaData(currentScene.itemContent.id)
if isValid(movieMetaData)
' Redraw movie poster
currentScene.newPosterImageURI = movieMetaData.posterURL
end if
end if
end if

Expand Down

0 comments on commit f36f975

Please sign in to comment.