Merge pull request #121 from thomabx/master

Show unplayed count on episodes and TV seasons
This commit is contained in:
Nick Bisby 2020-02-22 11:01:48 -06:00 committed by GitHub
commit 76fc41c23b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -181,8 +181,13 @@ function TVSeasons(id as string)
data = getJson(resp)
results = []
for each item in data.Items
imgParams = { "AddPlayedIndicator": item.UserData.Played }
if item.UserData.UnplayedItemCount > 0 then
param = { "UnplayedCount" : item.UserData.UnplayedItemCount }
imgParams.Append(param)
end if
tmp = CreateObject("roSGNode", "TVEpisodeData")
tmp.image = PosterImage(item.id)
tmp.image = PosterImage(item.id, imgParams)
tmp.json = item
results.push(tmp)
end for
@ -197,8 +202,9 @@ function TVEpisodes(show_id as string, season_id as string)
data = getJson(resp)
results = []
for each item in data.Items
imgParams = { "AddPlayedIndicator": item.UserData.Played }
tmp = CreateObject("roSGNode", "TVEpisodeData")
tmp.image = PosterImage(item.id)
tmp.image = PosterImage(item.id, imgParams)
if tmp.image <> invalid
tmp.image.posterDisplayMode = "scaleToFit"
end if