Skip to content

Commit 878d19f

Browse files
sevenratscewert
authored andcommitted
add channeldata
1 parent 7f59738 commit 878d19f

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

components/data/ChannelData.bs

+9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import "pkg:/source/api/Image.bs"
22
import "pkg:/source/api/baserequest.bs"
33
import "pkg:/source/utils/config.bs"
4+
import "pkg:/source/utils/fakeBlurhash.bs"
45

56
sub setFields()
67
json = m.top.json
@@ -20,5 +21,13 @@ sub setPoster()
2021

2122
imgParams = { "maxHeight": 440, "maxWidth": 295, "Tag": m.top.json.ImageTags.Primary }
2223
m.top.posterURL = ImageURL(m.top.json.id, "Primary", imgParams)
24+
if isValidAndNotEmpty(m.top.json.ImageBlurHashes.Primary)
25+
blurhash = m.top.json.ImageBlurHashes.Primary[m.top.json.ImageTags.Primary]
26+
if get_user_setting("ui.design.renderblurhashes") = "true" and isValidAndNotEmpty(blurhash)
27+
timer = CreateObject("roTimeSpan")
28+
m.top.posterBlurHashUrl = renderFakeBlurhash(blurhash, imgParams.maxWidth, imgParams.maxHeight)
29+
print "Took " + Str(timer.totalMilliseconds()) + " milliseconds to render a blurhash in ChannelData."
30+
end if
31+
end if
2332
end if
2433
end sub

components/data/PersonData.bs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ sub setPoster()
2424
if get_user_setting("ui.design.renderblurhashes") = "true" and isValidAndNotEmpty(blurhash)
2525
timer = CreateObject("roTimeSpan")
2626
m.top.posterBlurHashUrl = renderFakeBlurhash(blurhash, imgParams.maxWidth, imgParams.maxHeight)
27-
print "Took " + Str(timer.totalMilliseconds()) + " milliseconds to render a blurhash in MoviesData."
27+
print "Took " + Str(timer.totalMilliseconds()) + " milliseconds to render a blurhash in PersonData."
2828
end if
2929
end if
3030
else if m.top.json.BackdropImageTags[0] <> invalid

0 commit comments

Comments
 (0)