From e8fb4dfa0d86105f2ea066809e3ce507f262204f Mon Sep 17 00:00:00 2001 From: sevenrats Date: Sat, 11 Nov 2023 12:56:16 -0500 Subject: [PATCH] add channeldata --- components/data/ChannelData.bs | 9 +++++++++ components/data/PersonData.bs | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/components/data/ChannelData.bs b/components/data/ChannelData.bs index ff4ec8189..20cc83d92 100644 --- a/components/data/ChannelData.bs +++ b/components/data/ChannelData.bs @@ -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 @@ -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 diff --git a/components/data/PersonData.bs b/components/data/PersonData.bs index 03eef92d5..06678fc64 100644 --- a/components/data/PersonData.bs +++ b/components/data/PersonData.bs @@ -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