Skip to content

Commit

Permalink
add channeldata
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenrats committed Nov 11, 2023
1 parent e600026 commit 8bef9d7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions components/data/ChannelData.bs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import "pkg:/source/api/Image.bs"
import "pkg:/source/api/baserequest.bs"
import "pkg:/source/utils/config.bs"
import "pkg:/source/utils/fakeBlurhash.bs"

sub setFields()
json = m.top.json
Expand All @@ -20,5 +21,13 @@ sub setPoster()

imgParams = { "maxHeight": 440, "maxWidth": 295, "Tag": m.top.json.ImageTags.Primary }
m.top.posterURL = ImageURL(m.top.json.id, "Primary", imgParams)
if isValidAndNotEmpty(m.top.json.ImageBlurHashes.Primary)
blurhash = m.top.json.ImageBlurHashes.Primary[m.top.json.ImageTags.Primary]
if get_user_setting("ui.design.renderblurhashes") = "true" and isValidAndNotEmpty(blurhash)
timer = CreateObject("roTimeSpan")
m.top.posterBlurHashUrl = renderFakeBlurhash(blurhash, imgParams.maxWidth, imgParams.maxHeight)
print "Took " + Str(timer.totalMilliseconds()) + " milliseconds to render a blurhash in ChannelData."
end if
end if
end if
end sub
2 changes: 1 addition & 1 deletion components/data/PersonData.bs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ sub setPoster()
if get_user_setting("ui.design.renderblurhashes") = "true" and isValidAndNotEmpty(blurhash)
timer = CreateObject("roTimeSpan")
m.top.posterBlurHashUrl = renderFakeBlurhash(blurhash, imgParams.maxWidth, imgParams.maxHeight)
print "Took " + Str(timer.totalMilliseconds()) + " milliseconds to render a blurhash in MoviesData."
print "Took " + Str(timer.totalMilliseconds()) + " milliseconds to render a blurhash in PersonData."
end if
end if
else if m.top.json.BackdropImageTags[0] <> invalid
Expand Down

0 comments on commit 8bef9d7

Please sign in to comment.