Merge pull request #521 from jimdogx/feature/jf-264-add-audio-video-details-tv-details

This commit is contained in:
Neil Burrows 2022-02-13 15:40:01 +00:00 committed by GitHub
commit a9aaa45f10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 3 deletions

View File

@ -18,7 +18,7 @@ sub updateSize()
m.top.translation = [border, 75 + 115] m.top.translation = [border, 75 + 115]
itemWidth = (dimensions["width"] - border * 2) itemWidth = (dimensions["width"] - border * 2)
itemHeight = 300 itemHeight = 400
m.top.visible = true m.top.visible = true

View File

@ -19,12 +19,33 @@ sub itemContentChanged()
m.top.findNode("runtime").text = stri(getRuntime()).trim() + " mins" m.top.findNode("runtime").text = stri(getRuntime()).trim() + " mins"
m.top.findNode("endtime").text = tr("Ends at %1").Replace("%1", getEndTime()) m.top.findNode("endtime").text = tr("Ends at %1").Replace("%1", getEndTime())
end if end if
if itemData.communityRating <> invalid if itemData.communityRating <> invalid
m.top.findNode("star").visible = true m.top.findNode("star").visible = true
m.top.findNode("communityRating").text = str(int(itemData.communityRating * 10) / 10) m.top.findNode("communityRating").text = str(int(itemData.communityRating * 10) / 10)
else else
m.top.findNode("star").visible = false m.top.findNode("star").visible = false
end if 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 end sub
function getRuntime() as integer function getRuntime() as integer

View File

@ -3,7 +3,7 @@
<children> <children>
<LayoutGroup id="toplevel" layoutDirection="vert" itemSpacings="[40]"> <LayoutGroup id="toplevel" layoutDirection="vert" itemSpacings="[40]">
<LayoutGroup id="main_group" layoutDirection="horiz" itemSpacings="[30]"> <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]"> <LayoutGroup id="text" layoutDirection="vert" itemSpacings="[15]">
<!-- Using poster of 1 length to get spacing. Not successful with adding translation to title --> <!-- Using poster of 1 length to get spacing. Not successful with adding translation to title -->
<Poster id="null" height="1" /> <Poster id="null" height="1" />
@ -17,6 +17,10 @@
<Label id="endtime" font="font:SmallestSystemFont" /> <Label id="endtime" font="font:SmallestSystemFont" />
</LayoutGroup> </LayoutGroup>
<Label id="overview" wrap="true" height="170" width="1200" maxLines="4" ellipsizeOnBoundary="true"/> <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> </LayoutGroup>
</LayoutGroup> </LayoutGroup>

View File

@ -143,7 +143,7 @@ end function
function TVEpisodes(show_id as string, season_id as string) function TVEpisodes(show_id as string, season_id as string)
url = Substitute("Shows/{0}/Episodes", show_id) 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) data = getJson(resp)
results = [] results = []