mirror of
https://github.com/jellyfin/jellyfin-roku.git
synced 2024-11-28 00:40:39 +00:00
Add a Movie Details scene
This commit is contained in:
parent
134ec2e347
commit
b8c5ef149a
57
components/MovieItemDetails.xml
Normal file
57
components/MovieItemDetails.xml
Normal file
@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<component name="MovieItemDetailScene" extends="Scene">
|
||||
<children>
|
||||
<LayoutGroup layoutDirection="horiz">
|
||||
<Poster id="moviePoster"
|
||||
translation="[150,150]"
|
||||
width="196" height="294" />
|
||||
<LayoutGroup layoutDirection="vert" translation="[355, 150]">
|
||||
<Label id="title" />
|
||||
<LayoutGroup layoutDirection="horiz">
|
||||
<Label id="releaseYear" />
|
||||
<Label id="runtime" />
|
||||
<Label id="rating" />
|
||||
<Label id="stars" />
|
||||
<Label id="ends-at" />
|
||||
</LayoutGroup>
|
||||
<Label id="genres" />
|
||||
<Label id="director" />
|
||||
<Label id="video_codec" />
|
||||
<Label id="audio_codec" />
|
||||
<Label id="buttons" />
|
||||
<Label id="overview" />
|
||||
|
||||
</LayoutGroup>
|
||||
</LayoutGroup>
|
||||
</children>
|
||||
<interface>
|
||||
<field id="itemJson" type="associativearray" onChange="itemContentChanged" />
|
||||
</interface>
|
||||
<script type="text/brightscript" uri="pkg:/source/config.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/source/JellyfinAPI.brs" />
|
||||
<script type="text/brightscript">
|
||||
<![CDATA[
|
||||
sub init()
|
||||
|
||||
|
||||
end sub
|
||||
|
||||
sub itemContentChanged()
|
||||
itemData = m.top.itemJson
|
||||
|
||||
m.top.findNode("moviePoster").uri = ImageURL(itemData.id)
|
||||
m.top.findNode("title").text = itemData.name
|
||||
m.top.findNode("releaseYear").text = itemData.productionYear
|
||||
m.top.findNode("runtime").text = "100 mins"
|
||||
m.top.findNode("rating").text = itemData.officialRating
|
||||
m.top.findNode("stars").text = itemData.communityRating
|
||||
m.top.findNode("ends-at").text = "Someday"
|
||||
m.top.findNode("genres").text = "itemData.genres"
|
||||
m.top.findNode("director").text = "itemData.people"
|
||||
m.top.findNode("video_codec").text = "h264"
|
||||
m.top.findNode("audio_codec").text = "Eng AAC"
|
||||
m.top.findNode("overview").text = itemData.overview
|
||||
end sub
|
||||
]]>
|
||||
</script>
|
||||
</component>
|
@ -12,7 +12,8 @@ function buildURL(path as String, params={} as Object) as string
|
||||
item = field.key + "=" + req.escape(field.value.trim())
|
||||
else if type(field.value) = "roInteger" then
|
||||
item = field.key + "=" + req.escape(str(field.value).trim())
|
||||
else
|
||||
else if field <> invalid
|
||||
req = createObject("roUrlTransfer") ' Just so we can use it for escape
|
||||
item = field.key + "=" + req.escape(field.value)
|
||||
end if
|
||||
param_array.push(item)
|
||||
|
@ -124,7 +124,28 @@ sub ShowMovieOptions(library_id)
|
||||
return
|
||||
else if itemSelectedQ(msg)
|
||||
target = getMsgRowTarget(msg)
|
||||
showVideoPlayer(target.movieID)
|
||||
ShowMovieDetails(target.movieID)
|
||||
'showVideoPlayer(target.movieID)
|
||||
end if
|
||||
end while
|
||||
end sub
|
||||
|
||||
sub ShowMovieDetails(movie_id)
|
||||
port = CreateObject("roMessagePort")
|
||||
screen = CreateObject("roSGScreen")
|
||||
screen.setMessagePort(port)
|
||||
scene = screen.CreateScene("MovieItemDetailScene")
|
||||
|
||||
screen.show()
|
||||
|
||||
scene.itemJson = ItemMetaData(movie_id)
|
||||
|
||||
while true
|
||||
msg = wait(0, port)
|
||||
if type(msg) = "roSGScreenEvent" and msg.isScreenClosed() then
|
||||
return
|
||||
else if itemSelectedQ(msg)
|
||||
' showVideoPlayer(target.movieID)
|
||||
end if
|
||||
end while
|
||||
end sub
|
||||
|
Loading…
Reference in New Issue
Block a user