57 lines
1.4 KiB
XML
57 lines
1.4 KiB
XML
<?xml version="1.0" encoding="utf-8" ?>
|
|
<component name="MovieData" extends="ContentNode">
|
|
<interface>
|
|
<field id="title" type="string" />
|
|
<field id="posterUrl" type="string" />
|
|
<field id="movieID" type="string" />
|
|
<field id="description" type="string" />
|
|
<field id="favorite" type="boolean" />
|
|
<field id="watched" type="boolean" />
|
|
<field id="seasons" type="associativearray" />
|
|
<field id="container" type="string" />
|
|
<field id="json" type="associativearray" onChange="setFields" />
|
|
</interface>
|
|
<script type="text/brightscript">
|
|
<![CDATA[
|
|
sub setFields()
|
|
json = m.top.json
|
|
|
|
m.top.id = json.id
|
|
m.top.title = json.name
|
|
m.top.overview = json.overview
|
|
m.top.favorite = json.UserData.isFavorite
|
|
m.top.watched = json.UserData.played
|
|
|
|
setPoster()
|
|
setContainer()
|
|
end sub
|
|
|
|
sub setPoster()
|
|
json = m.top.json
|
|
|
|
if json.posterURL <> invalid
|
|
m.top.posterURL = json.posterURL
|
|
else
|
|
m.top.posterURL = ""
|
|
end if
|
|
|
|
end sub
|
|
|
|
sub setContainer()
|
|
json = m.top.json
|
|
|
|
if json.mediaSources = invalid then return
|
|
if json.mediaSources.count() = 0 then return
|
|
|
|
m.top.container = json.mediaSources[0].container
|
|
|
|
if m.top.container = invalid then m.top.container = ""
|
|
|
|
if m.top.container = "m4v" or m.top.container = "mov"
|
|
m.top.container = "mp4"
|
|
end if
|
|
end sub
|
|
]]>
|
|
</script>
|
|
</component>
|