Skip to content

Commit

Permalink
Add watched checkmark to Series, align
Browse files Browse the repository at this point in the history
  • Loading branch information
photonconvergence committed Dec 3, 2023
1 parent ce8917f commit c4b0af3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions components/ListPoster.bs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ sub init()
m.poster = m.top.findNode("poster")
m.unplayedCount = m.top.findNode("unplayedCount")
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")

Expand Down Expand Up @@ -65,6 +69,10 @@ sub itemContentChanged() as void
end if
end if

if isValid(itemData.json.UserData.Played) and itemData.json.UserData.Played = true
m.playedIndicator.visible = true
end if

if itemData.json.lookup("Type") = "Episode" and isValid(itemData.json.IndexNumber)
m.title.text = StrI(itemData.json.IndexNumber) + ". " + m.title.text

Expand Down
3 changes: 2 additions & 1 deletion components/ListPoster.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
<Rectangle id="backdrop" />
<ScrollingLabel id="Series" horizAlign="center" font="font:SmallSystemFont" repeatCount="0" visible="false" />
<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" />
</Rectangle>
<PlayedCheckmark id="playedIndicator" color="#00a4dcFF" width="90" height="60" translation="[102, 0]" visible="false" />
</Poster>
<ScrollingLabel id="title" horizAlign="center" font="font:SmallSystemFont" repeatCount="0" visible="false" />
<Label id="staticTitle" horizAlign="center" font="font:SmallSystemFont" wrap="false" />
Expand Down

0 comments on commit c4b0af3

Please sign in to comment.