Skip to content

Commit

Permalink
Merge pull request #605 from jimdogx/fixes/flickering-items
Browse files Browse the repository at this point in the history
Remove Tag query parameter
  • Loading branch information
jimdogx authored May 23, 2022
2 parents ba773a8 + 6b3dbdf commit 9b47ed6
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 54 deletions.
4 changes: 2 additions & 2 deletions components/data/ChannelData.brs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ sub setPoster()
if m.top.image <> invalid
m.top.posterURL = m.top.image.url
else if m.top.json.ImageTags <> invalid and m.top.json.ImageTags.Primary <> invalid
imgParams = { "maxHeight": 60, "Tag": m.top.json.ImageTags.Primary }
imgParams = { "maxHeight": 60 }
m.top.hdsmalliconurl = ImageURL(m.top.json.id, "Primary", imgParams)

imgParams = { "maxHeight": 440, "maxWidth": 295, "Tag": m.top.json.ImageTags.Primary }
imgParams = { "maxHeight": 440, "maxWidth": 295 }
m.top.posterURL = ImageURL(m.top.json.id, "Primary", imgParams)
end if
end sub
6 changes: 3 additions & 3 deletions components/data/CollectionData.brs
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ sub setPoster()
else

if m.top.json.ImageTags.Primary <> invalid
imgParams = { "maxHeight": 440, "maxWidth": 295, "Tag": m.top.json.ImageTags.Primary }
imgParams = { "maxHeight": 440, "maxWidth": 295 }
m.top.posterURL = ImageURL(m.top.json.id, "Primary", imgParams)
else if m.top.json.BackdropImageTags <> invalid
imgParams = { "maxHeight": 440, "Tag": m.top.json.BackdropImageTags[0] }
imgParams = { "maxHeight": 440 }
m.top.posterURL = ImageURL(m.top.json.id, "Backdrop", imgParams)
end if

' Add Backdrop Image
if m.top.json.BackdropImageTags <> invalid
imgParams = { "maxHeight": 720, "maxWidth": 1280, "Tag": m.top.json.BackdropImageTags[0] }
imgParams = { "maxHeight": 720, "maxWidth": 1280 }
m.top.backdropURL = ImageURL(m.top.json.id, "Backdrop", imgParams)
end if

Expand Down
2 changes: 1 addition & 1 deletion components/data/FolderData.brs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ sub setPoster()
if m.top.image <> invalid
m.top.posterURL = m.top.image.url
else if m.top.json.ImageTags.Primary <> invalid
imgParams = { "maxHeight": 440, "maxWidth": 295, "Tag": m.top.json.ImageTags.Primary }
imgParams = { "maxHeight": 440, "maxWidth": 295 }
m.top.posterURL = ImageURL(m.top.json.id, "Primary", imgParams)
end if
end sub
34 changes: 3 additions & 31 deletions components/data/HomeData.brs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sub setData()
' Set appropriate Images for Wide and Tall based on type

if datum.type = "CollectionFolder" or datum.type = "UserView"
params = { "Tag": datum.ImageTags.Primary, "maxHeight": 261, "maxWidth": 464 }
params = { "maxHeight": 261, "maxWidth": 464 }
m.top.thumbnailURL = ImageURL(datum.id, "Primary", params)
m.top.widePosterUrl = m.top.thumbnailURL

Expand All @@ -37,22 +37,14 @@ sub setData()
imgParams.Append({ "maxHeight": 261 })
imgParams.Append({ "maxWidth": 464 })

if datum.ImageTags.Primary <> invalid
param = { "Tag": datum.ImageTags.Primary }
imgParams.Append(param)
end if

m.top.thumbnailURL = ImageURL(datum.id, "Primary", imgParams)

' Add Wide Poster (Series Backdrop)
if datum.ParentThumbImageTag <> invalid
imgParams["Tag"] = datum.ParentThumbImageTag
m.top.widePosterUrl = ImageURL(datum.ParentThumbItemId, "Thumb", imgParams)
else if datum.ParentBackdropImageTags <> invalid
imgParams["Tag"] = datum.ParentBackdropImageTags[0]
m.top.widePosterUrl = ImageURL(datum.ParentBackdropItemId, "Backdrop", imgParams)
else if datum.ImageTags.Primary <> invalid
imgParams["Tag"] = datum.SeriesPrimaryImageTag
m.top.widePosterUrl = ImageURL(datum.id, "Primary", imgParams)
end if

Expand All @@ -64,18 +56,12 @@ sub setData()
imgParams["UnplayedCount"] = datum.UserData.UnplayedItemCount
end if

if datum.ImageTags.Primary <> invalid
imgParams["Tag"] = datum.ImageTags.Primary
end if

m.top.posterURL = ImageURL(datum.id, "Primary", imgParams)

' Add Wide Poster (Series Backdrop)
if datum.ImageTags <> invalid and datum.imageTags.Thumb <> invalid
imgParams["Tag"] = datum.imageTags.Thumb
m.top.widePosterUrl = ImageURL(datum.Id, "Thumb", imgParams)
else if datum.BackdropImageTags <> invalid
imgParams["Tag"] = datum.BackdropImageTags[0]
m.top.widePosterUrl = ImageURL(datum.Id, "Backdrop", imgParams)
end if

Expand All @@ -89,21 +75,14 @@ sub setData()
imgParams.Append({ "maxHeight": 261 })
imgParams.Append({ "maxWidth": 175 })

if datum.ImageTags.Primary <> invalid
param = { "Tag": datum.ImageTags.Primary }
imgParams.Append(param)
end if

m.top.posterURL = ImageURL(datum.id, "Primary", imgParams)

' For wide image, use backdrop
imgParams["maxWidth"] = 464

if datum.ImageTags <> invalid and datum.imageTags.Thumb <> invalid
imgParams["Tag"] = datum.imageTags.Thumb
m.top.thumbnailUrl = ImageURL(datum.Id, "Thumb", imgParams)
else if datum.BackdropImageTags[0] <> invalid
imgParams["Tag"] = datum.BackdropImageTags[0]
m.top.thumbnailUrl = ImageURL(datum.id, "Backdrop", imgParams)
end if

Expand All @@ -117,31 +96,24 @@ sub setData()
imgParams.Append({ "maxHeight": 261 })
imgParams.Append({ "maxWidth": 175 })

if datum.ImageTags.Primary <> invalid
param = { "Tag": datum.ImageTags.Primary }
imgParams.Append(param)
end if

m.top.posterURL = ImageURL(datum.id, "Primary", imgParams)

' For wide image, use backdrop
imgParams["maxWidth"] = 464

if datum.ImageTags <> invalid and datum.imageTags.Thumb <> invalid
imgParams["Tag"] = datum.imageTags.Thumb
m.top.thumbnailUrl = ImageURL(datum.Id, "Thumb", imgParams)
else if datum.BackdropImageTags[0] <> invalid
imgParams["Tag"] = datum.BackdropImageTags[0]
m.top.thumbnailUrl = ImageURL(datum.id, "Backdrop", imgParams)
end if
else if datum.type = "MusicAlbum"
params = { "Tag": datum.ImageTags.Primary, "maxHeight": 261, "maxWidth": 261 }
params = { "maxHeight": 261, "maxWidth": 261 }
m.top.thumbnailURL = ImageURL(datum.id, "Primary", params)
m.top.widePosterUrl = m.top.thumbnailURL
m.top.posterUrl = m.top.thumbnailURL

else if datum.type = "TvChannel" or datum.type = "Channel"
params = { "Tag": datum.ImageTags.Primary, "maxHeight": 261, "maxWidth": 464 }
params = { "maxHeight": 261, "maxWidth": 464 }
m.top.thumbnailURL = ImageURL(datum.id, "Primary", params)
m.top.widePosterUrl = m.top.thumbnailURL
m.top.iconUrl = "pkg:/images/media_type_icons/live_tv_white.png"
Expand Down
8 changes: 4 additions & 4 deletions components/data/MovieData.brs
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ sub setPoster()
else

if m.top.json.ImageTags.Primary <> invalid
imgParams = { "maxHeight": 440, "maxWidth": 295, "Tag": m.top.json.ImageTags.Primary }
imgParams = { "maxHeight": 440, "maxWidth": 295 }
m.top.posterURL = ImageURL(m.top.json.id, "Primary", imgParams)
else if m.top.json.BackdropImageTags[0] <> invalid
imgParams = { "maxHeight": 440, "Tag": m.top.json.BackdropImageTags[0] }
imgParams = { "maxHeight": 440 }
m.top.posterURL = ImageURL(m.top.json.id, "Backdrop", imgParams)
else if m.top.json.ParentThumbImageTag <> invalid and m.top.json.ParentThumbItemId <> invalid
imgParams = { "maxHeight": 440, "maxWidth": 295, "Tag": m.top.json.ParentThumbImageTag }
imgParams = { "maxHeight": 440, "maxWidth": 295 }
m.top.posterURL = ImageURL(m.top.json.ParentThumbItemId, "Thumb", imgParams)
end if

' Add Backdrop Image
if m.top.json.BackdropImageTags[0] <> invalid
imgParams = { "maxHeight": 720, "maxWidth": 1280, "Tag": m.top.json.BackdropImageTags[0] }
imgParams = { "maxHeight": 720, "maxWidth": 1280 }
m.top.backdropURL = ImageURL(m.top.json.id, "Backdrop", imgParams)
end if

Expand Down
8 changes: 4 additions & 4 deletions components/data/PersonData.brs
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ sub setPoster()
else

if m.top.json.ImageTags.Primary <> invalid
imgParams = { "maxHeight": 440, "maxWidth": 295, "Tag": m.top.json.ImageTags.Primary }
imgParams = { "maxHeight": 440, "maxWidth": 295 }
m.top.posterURL = ImageURL(m.top.json.id, "Primary", imgParams)
else if m.top.json.BackdropImageTags[0] <> invalid
imgParams = { "maxHeight": 440, "Tag": m.top.json.BackdropImageTags[0] }
imgParams = { "maxHeight": 440 }
m.top.posterURL = ImageURL(m.top.json.id, "Backdrop", imgParams)
else if m.top.json.ParentThumbImageTag <> invalid and m.top.json.ParentThumbItemId <> invalid
imgParams = { "maxHeight": 440, "maxWidth": 295, "Tag": m.top.json.ParentThumbImageTag }
imgParams = { "maxHeight": 440, "maxWidth": 295 }
m.top.posterURL = ImageURL(m.top.json.ParentThumbItemId, "Thumb", imgParams)
end if

' Add Backdrop Image
if m.top.json.BackdropImageTags[0] <> invalid
imgParams = { "maxHeight": 720, "maxWidth": 1280, "Tag": m.top.json.BackdropImageTags[0] }
imgParams = { "maxHeight": 720, "maxWidth": 1280 }
m.top.backdropURL = ImageURL(m.top.json.id, "Backdrop", imgParams)
end if

Expand Down
8 changes: 4 additions & 4 deletions components/data/PhotoData.brs
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ sub setPoster()
else

if m.top.json.ImageTags.Primary <> invalid
imgParams = { "maxHeight": 440, "maxWidth": 295, "Tag": m.top.json.ImageTags.Primary }
imgParams = { "maxHeight": 440, "maxWidth": 295 }
m.top.posterURL = ImageURL(m.top.json.id, "Primary", imgParams)
else if m.top.json.BackdropImageTags[0] <> invalid
imgParams = { "maxHeight": 440, "Tag": m.top.json.BackdropImageTags[0] }
imgParams = { "maxHeight": 440 }
m.top.posterURL = ImageURL(m.top.json.id, "Backdrop", imgParams)
else if m.top.json.ParentThumbImageTag <> invalid and m.top.json.ParentThumbItemId <> invalid
imgParams = { "maxHeight": 440, "maxWidth": 295, "Tag": m.top.json.ParentThumbImageTag }
imgParams = { "maxHeight": 440, "maxWidth": 295 }
m.top.posterURL = ImageURL(m.top.json.ParentThumbItemId, "Thumb", imgParams)
end if

' Add Backdrop Image
if m.top.json.BackdropImageTags[0] <> invalid
imgParams = { "maxHeight": 720, "maxWidth": 1280, "Tag": m.top.json.BackdropImageTags[0] }
imgParams = { "maxHeight": 720, "maxWidth": 1280 }
m.top.backdropURL = ImageURL(m.top.json.id, "Backdrop", imgParams)
end if

Expand Down
2 changes: 1 addition & 1 deletion components/data/ScheduleProgramData.brs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ sub setPoster()
m.top.posterURL = m.top.image.url
else
if m.top.json.ImageTags <> invalid and m.top.json.ImageTags.Thumb <> invalid
imgParams = { "maxHeight": 500, "maxWidth": 500, "Tag": m.top.json.ImageTags.Thumb }
imgParams = { "maxHeight": 500, "maxWidth": 500 }
m.top.posterURL = ImageURL(m.top.json.id, "Thumb", imgParams)
end if
end if
Expand Down
6 changes: 3 additions & 3 deletions components/data/SeriesData.brs
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ sub setPoster()

if m.top.json.ImageTags.Primary <> invalid

imgParams = { "maxHeight": 440, "maxWidth": 295, "Tag": m.top.json.ImageTags.Primary }
imgParams = { "maxHeight": 440, "maxWidth": 295 }
m.top.posterURL = ImageURL(m.top.json.id, "Primary", imgParams)
else if m.top.json.BackdropImageTags <> invalid
imgParams = { "maxHeight": 440, "Tag": m.top.json.BackdropImageTags[0] }
imgParams = { "maxHeight": 440 }
m.top.posterURL = ImageURL(m.top.json.id, "Backdrop", imgParams)
end if

' Add Backdrop Image
if m.top.json.BackdropImageTags <> invalid
imgParams = { "maxHeight": 720, "maxWidth": 1280, "Tag": m.top.json.BackdropImageTags[0] }
imgParams = { "maxHeight": 720, "maxWidth": 1280 }
m.top.backdropURL = ImageURL(m.top.json.id, "Backdrop", imgParams)
end if

Expand Down
2 changes: 1 addition & 1 deletion components/data/VideoData.brs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sub setPoster()
if m.top.image <> invalid
m.top.posterURL = m.top.image.url
else if m.top.json.ImageTags.Primary <> invalid
imgParams = { "maxHeight": 440, "maxWidth": 295, "Tag": m.top.json.ImageTags.Primary }
imgParams = { "maxHeight": 440, "maxWidth": 295 }
m.top.posterURL = ImageURL(m.top.json.id, "Primary", imgParams)
end if
end sub

0 comments on commit 9b47ed6

Please sign in to comment.