Merge pull request #1547 from photonconvergence/griditem-watched-checkmark

This commit is contained in:
Charles Ewert 2024-01-01 22:49:39 -05:00 committed by GitHub
commit 11f8b60e11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 29 additions and 5 deletions

View File

@ -15,6 +15,10 @@ sub init()
m.unplayedCount = m.top.findNode("unplayedCount") m.unplayedCount = m.top.findNode("unplayedCount")
m.unplayedEpisodeCount = m.top.findNode("unplayedEpisodeCount") m.unplayedEpisodeCount = m.top.findNode("unplayedEpisodeCount")
m.playedIndicator = m.top.findNode("playedIndicator")
m.checkmark = m.top.findNode("checkmark")
m.checkmark.width = 90
m.checkmark.height = 60
m.itemText.translation = [0, m.itemPoster.height + 7] m.itemText.translation = [0, m.itemPoster.height + 7]
@ -44,6 +48,10 @@ sub itemContentChanged()
if itemData = invalid then return if itemData = invalid then return
if itemData.type = "Movie" if itemData.type = "Movie"
if isValid(itemData.json) and isValid(itemData.json.UserData) and isValid(itemData.json.UserData.Played) and itemData.json.UserData.Played
m.playedIndicator.visible = true
end if
m.itemPoster.uri = itemData.PosterUrl m.itemPoster.uri = itemData.PosterUrl
m.itemIcon.uri = itemData.iconUrl m.itemIcon.uri = itemData.iconUrl
m.itemText.text = itemData.Title m.itemText.text = itemData.Title
@ -59,6 +67,9 @@ sub itemContentChanged()
end if end if
end if end if
end if end if
if isValid(itemData.json) and isValid(itemData.json.UserData) and isValid(itemData.json.UserData.Played) and itemData.json.UserData.Played = true
m.playedIndicator.visible = true
end if
m.itemPoster.uri = itemData.PosterUrl m.itemPoster.uri = itemData.PosterUrl
m.itemIcon.uri = itemData.iconUrl m.itemIcon.uri = itemData.iconUrl

View File

@ -7,6 +7,7 @@
<Rectangle id="unplayedCount" visible="false" width="90" height="60" color="#00a4dcFF" opacity=".99" translation="[201, 0]"> <Rectangle id="unplayedCount" visible="false" width="90" height="60" color="#00a4dcFF" opacity=".99" translation="[201, 0]">
<Label id="unplayedEpisodeCount" width="90" height="60" font="font:MediumBoldSystemFont" horizAlign="center" vertAlign="center" /> <Label id="unplayedEpisodeCount" width="90" height="60" font="font:MediumBoldSystemFont" horizAlign="center" vertAlign="center" />
</Rectangle> </Rectangle>
<PlayedCheckmark id="playedIndicator" color="#00a4dcFF" width="90" height="60" opacity=".99" translation="[201, 0]" visible="false" />
</Poster> </Poster>
<Poster id="itemIcon" width="50" height="50" translation="[230,10]" /> <Poster id="itemIcon" width="50" height="50" translation="[230,10]" />
<Label id="posterText" width="280" height="415" translation="[5,5]" horizAlign="center" vertAlign="center" ellipsizeOnBoundary="true" wrap="true" /> <Label id="posterText" width="280" height="415" translation="[5,5]" horizAlign="center" vertAlign="center" ellipsizeOnBoundary="true" wrap="true" />

View File

@ -8,6 +8,7 @@ sub init()
m.posterText.font.size = 30 m.posterText.font.size = 30
m.title.font.size = 25 m.title.font.size = 25
m.backdrop = m.top.findNode("backdrop") m.backdrop = m.top.findNode("backdrop")
m.playedIndicator = m.top.findNode("playedIndicator")
m.itemPoster.observeField("loadStatus", "onPosterLoadStatusChanged") m.itemPoster.observeField("loadStatus", "onPosterLoadStatusChanged")
@ -37,6 +38,10 @@ sub itemContentChanged()
if not isValid(itemData) then return if not isValid(itemData) then return
if isValid(itemData.json) and isValid(itemData.json.UserData) and isValid(itemData.json.UserData.Played) and itemData.json.UserData.Played
m.playedIndicator.visible = true
end if
m.itemPoster.uri = itemData.PosterUrl m.itemPoster.uri = itemData.PosterUrl
m.posterText.text = itemData.title m.posterText.text = itemData.title
m.title.text = itemData.title m.title.text = itemData.title

View File

@ -6,6 +6,7 @@
<ScrollingLabel translation="[0,340]" id="title" horizAlign="center" font="font:SmallSystemFont" repeatCount="0" maxWidth="230" /> <ScrollingLabel translation="[0,340]" id="title" horizAlign="center" font="font:SmallSystemFont" repeatCount="0" maxWidth="230" />
<Poster id="itemIcon" width="50" height="50" translation="[230,10]" /> <Poster id="itemIcon" width="50" height="50" translation="[230,10]" />
<Label id="posterText" width="230" height="320" translation="[5,5]" horizAlign="center" vertAlign="center" ellipsizeOnBoundary="true" wrap="true" /> <Label id="posterText" width="230" height="320" translation="[5,5]" horizAlign="center" vertAlign="center" ellipsizeOnBoundary="true" wrap="true" />
<PlayedCheckmark id="playedIndicator" color="#00a4dcFF" width="60" height="46" translation="[170, 15]" visible="false" />
</children> </children>
<interface> <interface>
<field id="itemContent" type="node" onChange="itemContentChanged" /> <field id="itemContent" type="node" onChange="itemContentChanged" />

View File

@ -8,6 +8,10 @@ sub init()
m.poster = m.top.findNode("poster") m.poster = m.top.findNode("poster")
m.unplayedCount = m.top.findNode("unplayedCount") m.unplayedCount = m.top.findNode("unplayedCount")
m.unplayedEpisodeCount = m.top.findNode("unplayedEpisodeCount") m.unplayedEpisodeCount = m.top.findNode("unplayedEpisodeCount")
m.playedIndicator = m.top.findNode("playedIndicator")
m.checkmark = m.top.findNode("checkmark")
m.checkmark.width = 90
m.checkmark.height = 60
m.backdrop = m.top.findNode("backdrop") m.backdrop = m.top.findNode("backdrop")
@ -65,6 +69,10 @@ sub itemContentChanged() as void
end if end if
end if end if
if isValid(itemData.json) and isValid(itemData.json.UserData) and isValid(itemData.json.UserData.Played) and itemData.json.UserData.Played
m.playedIndicator.visible = true
end if
if itemData.json.lookup("Type") = "Episode" and isValid(itemData.json.IndexNumber) if itemData.json.lookup("Type") = "Episode" and isValid(itemData.json.IndexNumber)
m.title.text = StrI(itemData.json.IndexNumber) + ". " + m.title.text m.title.text = StrI(itemData.json.IndexNumber) + ". " + m.title.text

View File

@ -4,9 +4,10 @@
<Rectangle id="backdrop" /> <Rectangle id="backdrop" />
<ScrollingLabel id="Series" horizAlign="center" font="font:SmallSystemFont" repeatCount="0" visible="false" /> <ScrollingLabel id="Series" horizAlign="center" font="font:SmallSystemFont" repeatCount="0" visible="false" />
<Poster id="poster" translation="[2,0]" loadDisplayMode="scaleToFit"> <Poster id="poster" translation="[2,0]" loadDisplayMode="scaleToFit">
<Rectangle id="unplayedCount" visible="false" width="90" height="60" color="#00a4dcFF" translation="[104, 0]"> <Rectangle id="unplayedCount" visible="false" width="90" height="60" color="#00a4dcFF" translation="[102, 0]">
<Label id="unplayedEpisodeCount" width="90" height="60" font="font:MediumBoldSystemFont" horizAlign="center" vertAlign="center" /> <Label id="unplayedEpisodeCount" width="90" height="60" font="font:MediumBoldSystemFont" horizAlign="center" vertAlign="center" />
</Rectangle> </Rectangle>
<PlayedCheckmark id="playedIndicator" color="#00a4dcFF" width="90" height="60" translation="[102, 0]" visible="false" />
</Poster> </Poster>
<ScrollingLabel id="title" horizAlign="center" font="font:SmallSystemFont" repeatCount="0" visible="false" /> <ScrollingLabel id="title" horizAlign="center" font="font:SmallSystemFont" repeatCount="0" visible="false" />
<Label id="staticTitle" horizAlign="center" font="font:SmallSystemFont" wrap="false" /> <Label id="staticTitle" horizAlign="center" font="font:SmallSystemFont" wrap="false" />

View File

@ -91,8 +91,6 @@ function ItemMetaData(id as string)
tmp.json = data tmp.json = data
return tmp return tmp
else if data.type = "Episode" else if data.type = "Episode"
' param = { "AddPlayedIndicator": data.UserData.Played }
' imgParams.Append(param)
tmp = CreateObject("roSGNode", "TVEpisodeData") tmp = CreateObject("roSGNode", "TVEpisodeData")
tmp.image = PosterImage(data.id, imgParams) tmp.image = PosterImage(data.id, imgParams)
tmp.json = data tmp.json = data
@ -410,9 +408,8 @@ function TVSeasons(id as string) as dynamic
results = [] results = []
for each item in data.Items for each item in data.Items
imgParams = { "AddPlayedIndicator": item.UserData.Played }
tmp = CreateObject("roSGNode", "TVSeasonData") tmp = CreateObject("roSGNode", "TVSeasonData")
tmp.image = PosterImage(item.id, imgParams) tmp.image = PosterImage(item.id)
tmp.json = item tmp.json = item
results.push(tmp) results.push(tmp)
end for end for