Merge pull request #521 from jimdogx/feature/jf-264-add-audio-video-details-tv-details
This commit is contained in:
commit
a9aaa45f10
|
@ -18,7 +18,7 @@ sub updateSize()
|
|||
m.top.translation = [border, 75 + 115]
|
||||
|
||||
itemWidth = (dimensions["width"] - border * 2)
|
||||
itemHeight = 300
|
||||
itemHeight = 400
|
||||
|
||||
m.top.visible = true
|
||||
|
||||
|
|
|
@ -19,12 +19,33 @@ sub itemContentChanged()
|
|||
m.top.findNode("runtime").text = stri(getRuntime()).trim() + " mins"
|
||||
m.top.findNode("endtime").text = tr("Ends at %1").Replace("%1", getEndTime())
|
||||
end if
|
||||
|
||||
if itemData.communityRating <> invalid
|
||||
m.top.findNode("star").visible = true
|
||||
m.top.findNode("communityRating").text = str(int(itemData.communityRating * 10) / 10)
|
||||
else
|
||||
m.top.findNode("star").visible = false
|
||||
end if
|
||||
|
||||
if itemData.MediaStreams <> invalid
|
||||
videoIdx = invalid
|
||||
audioIdx = invalid
|
||||
for i = 0 to itemData.MediaStreams.Count() - 1
|
||||
if itemData.MediaStreams[i].Type = "Video" and videoIdx = invalid
|
||||
videoIdx = i
|
||||
else if itemData.MediaStreams[i].Type = "Audio" and audioIdx = invalid
|
||||
audioIdx = i
|
||||
end if
|
||||
if videoIdx <> invalid and audioIdx <> invalid then exit for
|
||||
end for
|
||||
m.top.findNode("video_codec").text = tr("Video") + ": " + itemData.mediaStreams[videoIdx].DisplayTitle
|
||||
m.top.findNode("audio_codec").text = tr("Audio") + ": " + itemData.mediaStreams[audioIdx].DisplayTitle
|
||||
m.top.findNode("video_codec").visible = true
|
||||
m.top.findNode("audio_codec").visible = true
|
||||
else
|
||||
m.top.findNode("video_codec").visible = false
|
||||
m.top.findNode("audio_codec").visible = false
|
||||
end if
|
||||
end sub
|
||||
|
||||
function getRuntime() as integer
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<children>
|
||||
<LayoutGroup id="toplevel" layoutDirection="vert" itemSpacings="[40]">
|
||||
<LayoutGroup id="main_group" layoutDirection="horiz" itemSpacings="[30]">
|
||||
<Poster id="poster" width="534" height="300" />
|
||||
<Poster id="poster" width="534" height="400" />
|
||||
<LayoutGroup id="text" layoutDirection="vert" itemSpacings="[15]">
|
||||
<!-- Using poster of 1 length to get spacing. Not successful with adding translation to title -->
|
||||
<Poster id="null" height="1" />
|
||||
|
@ -17,6 +17,10 @@
|
|||
<Label id="endtime" font="font:SmallestSystemFont" />
|
||||
</LayoutGroup>
|
||||
<Label id="overview" wrap="true" height="170" width="1200" maxLines="4" ellipsizeOnBoundary="true"/>
|
||||
<LayoutGroup layoutDirection="horiz" itemSpacings="[15]">
|
||||
<Label id="video_codec" />
|
||||
<Label id="audio_codec" />
|
||||
</LayoutGroup>
|
||||
</LayoutGroup>
|
||||
</LayoutGroup>
|
||||
</LayoutGroup>
|
||||
|
|
|
@ -143,7 +143,7 @@ end function
|
|||
|
||||
function TVEpisodes(show_id as string, season_id as string)
|
||||
url = Substitute("Shows/{0}/Episodes", show_id)
|
||||
resp = APIRequest(url, { "seasonId": season_id, "UserId": get_setting("active_user") })
|
||||
resp = APIRequest(url, { "seasonId": season_id, "UserId": get_setting("active_user"), "fields": "MediaStreams" })
|
||||
|
||||
data = getJson(resp)
|
||||
results = []
|
||||
|
|
Loading…
Reference in New Issue
Block a user