@@ -25,6 +25,7 @@ def main(config):
25
25
plex_server_url = config .str ("plex_server_url" , "" )
26
26
plex_token = config .str ("plex_token" , "" )
27
27
show_heading = config .bool ("show_heading" , True )
28
+ show_only_artwork = config .bool ("show_only_artwork" , False )
28
29
heading_color = config .str ("heading_color" , "#FFA500" )
29
30
font_color = config .str ("font_color" , "#FFFFFF" )
30
31
show_summary = config .bool ("show_summary" , False )
@@ -38,6 +39,10 @@ def main(config):
38
39
fit_screen = config .bool ("fit_screen" , True )
39
40
debug_output = config .bool ("debug_output" , False )
40
41
42
+ if show_only_artwork :
43
+ show_heading = False
44
+ show_summary = False
45
+
41
46
ttl_seconds = 5
42
47
43
48
plex_endpoints = []
@@ -74,13 +79,14 @@ def main(config):
74
79
print ("CONFIG - filter_tv: " + str (filter_tv ))
75
80
print ("CONFIG - filter_music: " + str (filter_music ))
76
81
print ("CONFIG - show_heading: " + str (show_heading ))
82
+ print ("CONFIG - show_only_artwork: " + str (show_only_artwork ))
77
83
print ("CONFIG - heading_color: " + heading_color )
78
84
print ("CONFIG - font_color: " + font_color )
79
85
print ("CONFIG - fit_screen: " + str (fit_screen ))
80
86
81
- return get_text (plex_server_url , plex_token , endpoint_map , debug_output , fit_screen , filter_movie , filter_tv , filter_music , show_heading , show_summary , heading_color , font_color , ttl_seconds )
87
+ return get_text (plex_server_url , plex_token , endpoint_map , debug_output , fit_screen , filter_movie , filter_tv , filter_music , show_heading , show_only_artwork , show_summary , heading_color , font_color , ttl_seconds )
82
88
83
- def get_text (plex_server_url , plex_token , endpoint_map , debug_output , fit_screen , filter_movie , filter_tv , filter_music , show_heading , show_summary , heading_color , font_color , ttl_seconds ):
89
+ def get_text (plex_server_url , plex_token , endpoint_map , debug_output , fit_screen , filter_movie , filter_tv , filter_music , show_heading , show_only_artwork , show_summary , heading_color , font_color , ttl_seconds ):
84
90
base_url = plex_server_url
85
91
if base_url .endswith ("/" ):
86
92
base_url = base_url [0 :len (base_url ) - 1 ]
@@ -422,12 +428,22 @@ def get_text(plex_server_url, plex_token, endpoint_map, debug_output, fit_screen
422
428
# img = base64.decode(PLEX_BANNER_PORTRAIT)
423
429
# using_portrait_banner = True
424
430
425
- if show_summary :
431
+ if show_summary and show_only_artwork == False :
426
432
rendered_image = render .Image (
427
433
width = 22 ,
428
434
src = img ,
429
435
)
430
- elif fit_screen :
436
+ elif fit_screen and show_only_artwork == False :
437
+ rendered_image = render .Image (
438
+ width = 64 ,
439
+ src = img ,
440
+ )
441
+ elif fit_screen and show_only_artwork == True :
442
+ rendered_image = render .Image (
443
+ height = 32 ,
444
+ src = img ,
445
+ )
446
+ elif fit_screen == False and show_only_artwork == True :
431
447
rendered_image = render .Image (
432
448
width = 64 ,
433
449
src = img ,
@@ -438,7 +454,7 @@ def get_text(plex_server_url, plex_token, endpoint_map, debug_output, fit_screen
438
454
src = img ,
439
455
)
440
456
441
- return render_marquee (marquee_text_array , rendered_image , show_summary , debug_output , using_portrait_banner )
457
+ return render_marquee (show_only_artwork , marquee_text_array , rendered_image , show_summary , debug_output , using_portrait_banner )
442
458
443
459
else :
444
460
display_message_string = "No valid results for " + endpoint_map ["title" ]
@@ -575,9 +591,9 @@ def display_message(debug_output, message_array = [], show_summary = False):
575
591
width = 64 ,
576
592
src = img ,
577
593
)
578
- return render_marquee (message_array , rendered_image , show_summary , debug_output )
594
+ return render_marquee (False , message_array , rendered_image , show_summary , debug_output )
579
595
580
- def render_marquee (message_array , image , show_summary , debug_output , using_portrait_banner = False ):
596
+ def render_marquee (show_only_artwork , message_array , image , show_summary , debug_output , using_portrait_banner = False ):
581
597
icon_img = base64 .decode (PLEX_ICON )
582
598
583
599
text_array = []
@@ -636,7 +652,7 @@ def render_marquee(message_array, image, show_summary, debug_output, using_portr
636
652
if show_summary == False and debug_output :
637
653
print ("Marquee text: " + full_message )
638
654
639
- if show_summary :
655
+ if show_summary and show_only_artwork == False :
640
656
marquee_height = 32 + ((heading_lines + title_lines + body_lines ) - ((heading_lines + title_lines + body_lines ) * 0.62 ))
641
657
642
658
children = [
@@ -687,6 +703,18 @@ def render_marquee(message_array, image, show_summary, debug_output, using_portr
687
703
),
688
704
),
689
705
)
706
+ elif show_only_artwork == True :
707
+ return render .Root (
708
+ show_full_animation = True ,
709
+ child = render .Row (
710
+ expanded = True ,
711
+ main_align = "space_evenly" ,
712
+ cross_align = "center" ,
713
+ children = [
714
+ image ,
715
+ ],
716
+ ),
717
+ )
690
718
else :
691
719
marquee_width = 57 + ((len (full_message )) - ((len (full_message )) * 0.9 ))
692
720
@@ -844,14 +872,14 @@ def get_schema():
844
872
schema .Text (
845
873
id = "plex_server_url" ,
846
874
name = "Plex server URL (required)" ,
847
- desc = "Plex server URL." ,
875
+ desc = "Your Plex server URL." ,
848
876
icon = "globe" ,
849
877
default = "" ,
850
878
),
851
879
schema .Text (
852
880
id = "plex_token" ,
853
881
name = "Plex token (required)" ,
854
- desc = "Plex token." ,
882
+ desc = "Your Plex token." ,
855
883
icon = "key" ,
856
884
default = "" ,
857
885
),
@@ -883,6 +911,13 @@ def get_schema():
883
911
icon = "alignLeft" ,
884
912
default = False ,
885
913
),
914
+ schema .Toggle (
915
+ id = "show_only_artwork" ,
916
+ name = "Show Only Artwork" ,
917
+ desc = "Display only the artwork. Overrides 'Show summary' and 'Show heading' configurations." ,
918
+ icon = "eye" ,
919
+ default = False ,
920
+ ),
886
921
schema .Toggle (
887
922
id = "fit_screen" ,
888
923
name = "Fit screen" ,
0 commit comments