File tree 18 files changed +355
-3
lines changed
18 files changed +355
-3
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,11 @@ sub itemContentChanged()
37
37
38
38
' Set Random background colors from pallet
39
39
posterBackgrounds = m .global .constants .poster_bg_pallet
40
- m .backdrop .blendColor = posterBackgrounds [rnd (posterBackgrounds .count ()) - 1 ]
40
+ if isValidAndNotEmpty (m .top .itemContent .posterBlurhashUrl ):
41
+ m .backdrop .uri = m .top .itemContent .posterBlurhashUrl
42
+ else
43
+ m .backdrop .blendColor = posterBackgrounds [rnd (posterBackgrounds .count ()) - 1 ]
44
+ end if
41
45
42
46
itemData = m .top .itemContent
43
47
Original file line number Diff line number Diff line change 1
1
import "pkg:/source/utils/misc.brs"
2
2
import "pkg:/source/utils/config.brs"
3
+ import "pkg:/source/utils/fakeBlurhash.brs"
3
4
4
5
sub init ()
5
6
m .itemPoster = m .top .findNode ("itemPoster" )
@@ -23,7 +24,11 @@ sub init()
23
24
end sub
24
25
25
26
sub itemContentChanged ()
26
- m .backdrop .blendColor = "#101010"
27
+ if isValidAndNotEmpty (m .top .itemContent .posterBlurhashUrl ):
28
+ m .backdrop .uri = m .top .itemContent .posterBlurhashUrl
29
+ else
30
+ m .backdrop .blendColor = "#101010"
31
+ end if
27
32
28
33
m .title .visible = false
29
34
Original file line number Diff line number Diff line change 1
1
import "pkg:/source/api/Image.brs"
2
2
import "pkg:/source/api/baserequest.brs"
3
3
import "pkg:/source/utils/config.brs"
4
+ import "pkg:/source/utils/fakeBlurhash.brs"
4
5
5
6
sub setFields ()
6
7
json = m .top .json
@@ -14,11 +15,19 @@ end sub
14
15
sub setPoster ()
15
16
if m .top .image <> invalid
16
17
m .top .posterURL = m .top .image .url
17
- else if m .top .json .ImageTags <> invalid and m .top .json .ImageTags .Primary <> invalid
18
+ else if isValid ( m .top .json .ImageTags ) and isValid ( m .top .json .ImageTags .Primary )
18
19
imgParams = { "maxHeight" : 60 , "Tag" : m .top .json .ImageTags .Primary }
19
20
m .top .hdsmalliconurl = ImageURL (m .top .json .id , "Primary" , imgParams )
20
21
21
22
imgParams = { "maxHeight" : 440 , "maxWidth" : 295 , "Tag" : m .top .json .ImageTags .Primary }
22
23
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." ' DELETE THIS TEMPORARY LINE OF DEV CODE
30
+ end if
31
+ end if
23
32
end if
24
33
end sub
Original file line number Diff line number Diff line change 1
1
import "pkg:/source/api/Image.brs"
2
2
import "pkg:/source/api/baserequest.brs"
3
3
import "pkg:/source/utils/config.brs"
4
+ import "pkg:/source/utils/fakeBlurhash.brs"
4
5
5
6
sub setFields ()
6
7
json = m .top .json
@@ -24,9 +25,18 @@ sub setPoster()
24
25
if m .top .json .ImageTags .Primary <> invalid
25
26
imgParams = { "maxHeight" : 440 , "maxWidth" : 295 , "Tag" : m .top .json .ImageTags .Primary }
26
27
m .top .posterURL = ImageURL (m .top .json .id , "Primary" , imgParams )
28
+ if isValidAndNotEmpty (m .top .json .ImageBlurHashes .Primary )
29
+ blurhash = m .top .json .ImageBlurHashes .Primary [m .top .json .ImageTags .Primary ]
30
+ if get_user_setting ("ui.design.renderblurhashes" ) = "true" and isValidAndNotEmpty (blurhash )
31
+ 'timer = CreateObject("roTimeSpan")
32
+ m .top .posterBlurHashUrl = renderFakeBlurhash (blurhash , imgParams .maxWidth , imgParams .maxHeight )
33
+ 'print "Took " + Str(timer.totalMilliseconds()) + " milliseconds to render a blurhash in CollectionData."' DELETE THIS TEMPORARY LINE OF DEV CODE
34
+ end if
35
+ end if
27
36
else if m .top .json .BackdropImageTags <> invalid
28
37
imgParams = { "maxHeight" : 440 , "Tag" : m .top .json .BackdropImageTags [0 ] }
29
38
m .top .posterURL = ImageURL (m .top .json .id , "Backdrop" , imgParams )
39
+
30
40
end if
31
41
32
42
' Add Backdrop Image
Original file line number Diff line number Diff line change 1
1
import "pkg:/source/api/Image.brs"
2
2
import "pkg:/source/api/baserequest.brs"
3
3
import "pkg:/source/utils/config.brs"
4
+ import "pkg:/source/utils/fakeBlurhash.brs"
4
5
5
6
sub setFields ()
6
7
json = m .top .json
@@ -27,6 +28,14 @@ sub setPoster()
27
28
else if m .top .json .ImageTags .Primary <> invalid
28
29
imgParams = { "maxHeight" : 440 , "maxWidth" : 295 , "Tag" : m .top .json .ImageTags .Primary }
29
30
m .top .posterURL = ImageURL (m .top .json .id , "Primary" , imgParams )
31
+ if isValidAndNotEmpty (m .top .json .ImageBlurHashes .Primary )
32
+ blurhash = m .top .json .ImageBlurHashes .Primary [m .top .json .ImageTags .Primary ]
33
+ if get_user_setting ("ui.design.renderblurhashes" ) = "true" and isValidAndNotEmpty (blurhash )
34
+ 'timer = CreateObject("roTimeSpan")
35
+ m .top .posterBlurHashUrl = renderFakeBlurhash (blurhash , imgParams .maxWidth , imgParams .maxHeight )
36
+ 'print "Took " + Str(timer.totalMilliseconds()) + " milliseconds to render a blurhash in FolderData."' DELETE THIS TEMPORARY LINE OF DEV CODE
37
+ end if
38
+ end if
30
39
end if
31
40
end sub
32
41
Original file line number Diff line number Diff line change 4
4
<field id =" favorite" type =" boolean" />
5
5
<field id =" watched" type =" boolean" />
6
6
<field id =" posterUrl" type =" string" />
7
+ <field id =" posterBlurhashUrl" type =" string" />
7
8
<field id =" backdropUrl" type =" string" />
8
9
<field id =" SubTitle" type =" string" value =" " />
9
10
<field id =" iconUrl" type =" string" value =" " />
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import "pkg:/source/api/Image.brs"
2
2
import "pkg:/source/api/baserequest.brs"
3
3
import "pkg:/source/utils/config.brs"
4
4
import "pkg:/source/utils/misc.brs"
5
+ import "pkg:/source/utils/fakeBlurhash.brs"
5
6
6
7
sub setFields ()
7
8
json = m .top .json
@@ -47,6 +48,14 @@ sub setPoster()
47
48
if isValid (m .top .json .ImageTags ) and isValid (m .top .json .ImageTags .Primary )
48
49
imgParams = { "maxHeight" : 440 , "maxWidth" : 295 , "Tag" : m .top .json .ImageTags .Primary }
49
50
m .top .posterURL = ImageURL (m .top .json .id , "Primary" , imgParams )
51
+ if isValidAndNotEmpty (m .top .json .ImageBlurHashes .Primary )
52
+ blurhash = m .top .json .ImageBlurHashes .Primary [m .top .json .ImageTags .Primary ]
53
+ if get_user_setting ("ui.design.renderblurhashes" ) = "true" and isValidAndNotEmpty (blurhash )
54
+ 'timer = CreateObject("roTimeSpan")
55
+ m .top .posterBlurHashUrl = renderFakeBlurhash (blurhash , imgParams .maxWidth , imgParams .maxHeight )
56
+ 'print "Took " + Str(timer.totalMilliseconds()) + " milliseconds to render a blurhash in MoviesData."' DELETE THIS TEMPORARY LINE OF DEV CODE
57
+ end if
58
+ end if
50
59
else if isValid (m .top .json .BackdropImageTags ) and isValid (m .top .json .BackdropImageTags [0 ])
51
60
imgParams = { "maxHeight" : 440 , "Tag" : m .top .json .BackdropImageTags [0 ] }
52
61
m .top .posterURL = ImageURL (m .top .json .id , "Backdrop" , imgParams )
Original file line number Diff line number Diff line change 1
1
import "pkg:/source/api/Image.brs"
2
2
import "pkg:/source/api/baserequest.brs"
3
3
import "pkg:/source/utils/config.brs"
4
+ import "pkg:/source/utils/fakeBlurhash.brs"
4
5
5
6
sub setFields ()
6
7
json = m .top .json
@@ -18,6 +19,14 @@ sub setPoster()
18
19
if m .top .json .ImageTags .Primary <> invalid
19
20
imgParams = { "maxHeight" : 440 , "maxWidth" : 295 }
20
21
m .top .posterURL = ImageURL (m .top .json .id , "Primary" , imgParams )
22
+ if isValidAndNotEmpty (m .top .json .ImageBlurHashes .Primary )
23
+ blurhash = m .top .json .ImageBlurHashes .Primary [m .top .json .ImageTags .Primary ]
24
+ if get_user_setting ("ui.design.renderblurhashes" ) = "true" and isValidAndNotEmpty (blurhash )
25
+ 'timer = CreateObject("roTimeSpan")
26
+ m .top .posterBlurHashUrl = renderFakeBlurhash (blurhash , imgParams .maxWidth , imgParams .maxHeight )
27
+ 'print "Took " + Str(timer.totalMilliseconds()) + " milliseconds to render a blurhash in MusicAlbumSongListData."' DELETE THIS TEMPORARY LINE OF DEV CODE
28
+ end if
29
+ end if
21
30
else if m .top .json .BackdropImageTags [0 ] <> invalid
22
31
imgParams = { "maxHeight" : 440 }
23
32
m .top .posterURL = ImageURL (m .top .json .id , "Backdrop" , imgParams )
Original file line number Diff line number Diff line change 1
1
import "pkg:/source/api/Image.brs"
2
2
import "pkg:/source/api/baserequest.brs"
3
3
import "pkg:/source/utils/config.brs"
4
+ import "pkg:/source/utils/fakeBlurhash.brs"
4
5
5
6
sub setFields ()
6
7
json = m .top .json
@@ -21,6 +22,14 @@ sub setPoster()
21
22
if m .top .json .ImageTags .Primary <> invalid
22
23
imgParams = { "maxHeight" : 440 , "maxWidth" : 440 }
23
24
m .top .posterURL = ImageURL (m .top .json .id , "Primary" , imgParams )
25
+ if isValidAndNotEmpty (m .top .json .ImageBlurHashes .Primary )
26
+ blurhash = m .top .json .ImageBlurHashes .Primary [m .top .json .ImageTags .Primary ]
27
+ if get_user_setting ("ui.design.renderblurhashes" ) = "true" and isValidAndNotEmpty (blurhash )
28
+ 'timer = CreateObject("roTimeSpan")
29
+ m .top .posterBlurHashUrl = renderFakeBlurhash (blurhash , imgParams .maxWidth , imgParams .maxHeight )
30
+ 'print "Took " + Str(timer.totalMilliseconds()) + " milliseconds to render a blurhash in MusicArtistData."' DELETE THIS TEMPORARY LINE OF DEV CODE
31
+ end if
32
+ end if
24
33
else if m .top .json .BackdropImageTags [0 ] <> invalid
25
34
imgParams = { "maxHeight" : 440 }
26
35
m .top .posterURL = ImageURL (m .top .json .id , "Backdrop" , imgParams )
Original file line number Diff line number Diff line change 1
1
import "pkg:/source/api/Image.brs"
2
2
import "pkg:/source/api/baserequest.brs"
3
3
import "pkg:/source/utils/config.brs"
4
+ import "pkg:/source/utils/fakeBlurhash.brs"
4
5
5
6
sub setFields ()
6
7
json = m .top .json
@@ -18,6 +19,14 @@ sub setPoster()
18
19
if m .top .json .ImageTags .Primary <> invalid
19
20
imgParams = { "maxHeight" : 440 , "maxWidth" : 295 , "Tag" : m .top .json .ImageTags .Primary }
20
21
m .top .posterURL = ImageURL (m .top .json .id , "Primary" , imgParams )
22
+ if isValidAndNotEmpty (m .top .json .ImageBlurHashes .Primary )
23
+ blurhash = m .top .json .ImageBlurHashes .Primary [m .top .json .ImageTags .Primary ]
24
+ if get_user_setting ("ui.design.renderblurhashes" ) = "true" and isValidAndNotEmpty (blurhash )
25
+ 'timer = CreateObject("roTimeSpan")
26
+ m .top .posterBlurHashUrl = renderFakeBlurhash (blurhash , imgParams .maxWidth , imgParams .maxHeight )
27
+ 'print "Took " + Str(timer.totalMilliseconds()) + " milliseconds to render a blurhash in MoviesData."' DELETE THIS TEMPORARY LINE OF DEV CODE
28
+ end if
29
+ end if
21
30
else if m .top .json .BackdropImageTags [0 ] <> invalid
22
31
imgParams = { "maxHeight" : 440 , "Tag" : m .top .json .BackdropImageTags [0 ] }
23
32
m .top .posterURL = ImageURL (m .top .json .id , "Backdrop" , imgParams )
Original file line number Diff line number Diff line change 1
1
import "pkg:/source/api/Image.brs"
2
2
import "pkg:/source/api/baserequest.brs"
3
3
import "pkg:/source/utils/config.brs"
4
+ import "pkg:/source/utils/fakeBlurhash.brs"
4
5
5
6
sub setFields ()
6
7
json = m .top .json
@@ -20,6 +21,14 @@ sub setPoster()
20
21
if m .top .json .ImageTags .Primary <> invalid
21
22
imgParams = { "maxHeight" : 440 , "maxWidth" : 295 , "Tag" : m .top .json .ImageTags .Primary }
22
23
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 PhotoData."' DELETE THIS TEMPORARY LINE OF DEV CODE
30
+ end if
31
+ end if
23
32
else if m .top .json .BackdropImageTags [0 ] <> invalid
24
33
imgParams = { "maxHeight" : 440 , "Tag" : m .top .json .BackdropImageTags [0 ] }
25
34
m .top .posterURL = ImageURL (m .top .json .id , "Backdrop" , imgParams )
Original file line number Diff line number Diff line change 1
1
import "pkg:/source/api/Image.brs"
2
2
import "pkg:/source/api/baserequest.brs"
3
3
import "pkg:/source/utils/config.brs"
4
+ import "pkg:/source/utils/fakeBlurhash.brs"
4
5
5
6
sub setFields ()
6
7
json = m .top .json
@@ -42,6 +43,15 @@ sub setPoster()
42
43
if m .top .json .ImageTags <> invalid and m .top .json .ImageTags .Thumb <> invalid
43
44
imgParams = { "maxHeight" : 500 , "maxWidth" : 500 , "Tag" : m .top .json .ImageTags .Thumb }
44
45
m .top .posterURL = ImageURL (m .top .json .id , "Thumb" , imgParams )
46
+ if isValidAndNotEmpty (m .top .json .ImageBlurHashes .Primary )
47
+ blurhash = m .top .json .ImageBlurHashes .Primary [m .top .json .ImageTags .Primary ]
48
+ if get_user_setting ("ui.design.renderblurhashes" ) = "true" and isValidAndNotEmpty (blurhash )
49
+ 'timer = CreateObject("roTimeSpan")
50
+ m .top .posterBlurHashUrl = renderFakeBlurhash (blurhash , imgParams .maxWidth , imgParams .maxHeight )
51
+ 'print "Took " + Str(timer.totalMilliseconds()) + " milliseconds to render a blurhash in ScheduleProgramData."' DELETE THIS TEMPORARY LINE OF DEV CODE
52
+ end if
53
+ end if
54
+
45
55
end if
46
56
end if
47
57
end sub
Original file line number Diff line number Diff line change 1
1
import "pkg:/source/api/Image.brs"
2
2
import "pkg:/source/api/baserequest.brs"
3
3
import "pkg:/source/utils/config.brs"
4
+ import "pkg:/source/utils/fakeBlurhash.brs"
4
5
5
6
sub setFields ()
6
7
json = m .top .json
@@ -38,6 +39,14 @@ sub setPoster()
38
39
39
40
imgParams = { "maxHeight" : 440 , "maxWidth" : 295 , "Tag" : m .top .json .ImageTags .Primary }
40
41
m .top .posterURL = ImageURL (m .top .json .id , "Primary" , imgParams )
42
+ if isValidAndNotEmpty (m .top .json .ImageBlurHashes .Primary )
43
+ blurhash = m .top .json .ImageBlurHashes .Primary [m .top .json .ImageTags .Primary ]
44
+ if get_user_setting ("ui.design.renderblurhashes" ) = "true" and isValidAndNotEmpty (blurhash )
45
+ 'timer = CreateObject("roTimeSpan")
46
+ m .top .posterBlurHashUrl = renderFakeBlurhash (blurhash , imgParams .maxWidth , imgParams .maxHeight )
47
+ 'print "Took " + Str(timer.totalMilliseconds()) + " milliseconds to render a blurhash in SeriesData."' DELETE THIS TEMPORARY LINE OF DEV CODE
48
+ end if
49
+ end if
41
50
else if m .top .json .BackdropImageTags <> invalid
42
51
imgParams = { "maxHeight" : 440 , "Tag" : m .top .json .BackdropImageTags [0 ] }
43
52
m .top .posterURL = ImageURL (m .top .json .id , "Backdrop" , imgParams )
Original file line number Diff line number Diff line change 1
1
import "pkg:/source/api/Image.brs"
2
2
import "pkg:/source/api/baserequest.brs"
3
3
import "pkg:/source/utils/config.brs"
4
+ import "pkg:/source/utils/fakeBlurhash.brs"
4
5
5
6
sub setFields ()
6
7
json = m .top .json
@@ -21,5 +22,13 @@ sub setPoster()
21
22
else if m .top .json .ImageTags .Primary <> invalid
22
23
imgParams = { "maxHeight" : 440 , "maxWidth" : 295 }
23
24
m .top .posterURL = ImageURL (m .top .json .id , "Primary" , imgParams )
25
+ if isValidAndNotEmpty (m .top .json .ImageBlurHashes .Primary )
26
+ blurhash = m .top .json .ImageBlurHashes .Primary [m .top .json .ImageTags .Primary ]
27
+ if get_user_setting ("ui.design.renderblurhashes" ) = "true" and isValidAndNotEmpty (blurhash )
28
+ 'timer = CreateObject("roTimeSpan")
29
+ m .top .posterBlurHashUrl = renderFakeBlurhash (blurhash , imgParams .maxWidth , imgParams .maxHeight )
30
+ 'print "Took " + Str(timer.totalMilliseconds()) + " milliseconds to render a blurhash in MoviesData."' DELETE THIS TEMPORARY LINE OF DEV CODE
31
+ end if
32
+ end if
24
33
end if
25
34
end sub
Original file line number Diff line number Diff line change 1
1
import "pkg:/source/api/Image.brs"
2
2
import "pkg:/source/api/baserequest.brs"
3
3
import "pkg:/source/utils/config.brs"
4
+ import "pkg:/source/utils/fakeBlurhash.brs"
4
5
5
6
sub setFields ()
6
7
json = m .top .json
@@ -21,5 +22,13 @@ sub setPoster()
21
22
else if m .top .json .ImageTags .Primary <> invalid
22
23
imgParams = { "maxHeight" : 440 , "maxWidth" : 295 , "Tag" : m .top .json .ImageTags .Primary }
23
24
m .top .posterURL = ImageURL (m .top .json .id , "Primary" , imgParams )
25
+ if isValidAndNotEmpty (m .top .json .ImageBlurHashes .Primary )
26
+ blurhash = m .top .json .ImageBlurHashes .Primary [m .top .json .ImageTags .Primary ]
27
+ if get_user_setting ("ui.design.renderblurhashes" ) = "true" and isValidAndNotEmpty (blurhash )
28
+ 'timer = CreateObject("roTimeSpan")
29
+ m .top .posterBlurHashUrl = renderFakeBlurhash (blurhash , imgParams .maxWidth , imgParams .maxHeight )
30
+ 'print "Took " + Str(timer.totalMilliseconds()) + " milliseconds to render a blurhash in VideoData."' DELETE THIS TEMPORARY LINE OF DEV CODE
31
+ end if
32
+ end if
24
33
end if
25
34
end sub
Original file line number Diff line number Diff line change 218
218
"type" : " integer" ,
219
219
"default" : " 365"
220
220
},
221
+ {
222
+ "title" : " Render blurhashes" ,
223
+ "description" : " Use an EXPERIMENTAL algorithm to render image blurhashes. This may slow down page loading and cause the app the crash." ,
224
+ "settingName" : " ui.design.renderblurhashes" ,
225
+ "type" : " bool" ,
226
+ "default" : " false"
227
+ },
221
228
{
222
229
"title" : " Show What's New Popup" ,
223
230
"description" : " Show What's New popup when Jellyfin is updated to a new version." ,
You can’t perform that action at this time.
0 commit comments