Skip to content

Commit

Permalink
remove dev comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenrats committed Nov 11, 2023
1 parent 3991e1e commit 9299aba
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
10 changes: 10 additions & 0 deletions components/data/CollectionData.bs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
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 @@ -24,6 +26,14 @@ sub setPoster()
if m.top.json.ImageTags.Primary <> invalid
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 CollectionData."
end if
end if
else if m.top.json.BackdropImageTags <> invalid
imgParams = { "maxHeight": 440, "Tag": m.top.json.BackdropImageTags[0] }
m.top.posterURL = ImageURL(m.top.json.id, "Backdrop", imgParams)
Expand Down
9 changes: 9 additions & 0 deletions components/data/FolderData.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 @@ -27,6 +28,14 @@ sub setPoster()
else if m.top.json.ImageTags.Primary <> invalid
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 FolderData."
end if
end if
end if
end sub

Expand Down
4 changes: 2 additions & 2 deletions components/data/MovieData.bs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ sub setPoster()
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")
'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 MoviesData."' DELETE THIS TEMPORARY LINE OF DEV CODE
end if
end if
else if isValid(m.top.json.BackdropImageTags) and isValid(m.top.json.BackdropImageTags[0])
Expand Down
2 changes: 1 addition & 1 deletion components/data/MusicArtistData.bs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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 MusicArtistData."' DELETE THIS TEMPORARY LINE OF DEV CODE
'print "Took " + Str(timer.totalMilliseconds()) + " milliseconds to render a blurhash in MusicArtistData."
end if
end if
else if m.top.json.BackdropImageTags[0] <> invalid
Expand Down

0 comments on commit 9299aba

Please sign in to comment.