@@ -27,9 +27,9 @@ def asset_to_tiles(asset):
27
27
"x2" : 1920 ,
28
28
"y2" : 1080 ,
29
29
"config" : {
30
+ "fade_time" : 0.5 ,
30
31
"layer" : - 5 ,
31
32
"looped" : True ,
32
- "fade_time" : 0.5 ,
33
33
},
34
34
}
35
35
)
@@ -82,19 +82,25 @@ def asset_to_tiles(asset):
82
82
83
83
84
84
pages = []
85
+ assets_visible = set ()
85
86
for asset in get_all_live_assets ():
86
87
pages .append (
87
88
{
88
- "tiles" : asset_to_tiles (asset ),
89
+ "auto_duration" : 10 ,
90
+ "duration" : 10 ,
89
91
"interaction" : {"key" : "" },
90
92
"layout_id" : - 1 , # Use first layout
91
93
"overlap" : 0 ,
92
- "auto_duration" : 10 ,
93
- "duration" : 10 ,
94
+ "tiles" : asset_to_tiles (asset ),
94
95
}
95
96
)
97
+ assets_visible .add (asset ["id" ])
96
98
97
- log .info ("There are currently {} pages visible" .format (len (pages )))
99
+ log .info (
100
+ "There are currently {} pages visible with asset ids: {}" .format (
101
+ len (pages ), ", " .join ([str (i ) for i in sorted (assets_visible )])
102
+ )
103
+ )
98
104
99
105
for setup_id in CONFIG ["SETUP_IDS" ]:
100
106
slog = getLogger (f"Setup { setup_id } " )
@@ -105,8 +111,19 @@ def asset_to_tiles(asset):
105
111
for schedule in config ["schedules" ]:
106
112
if schedule ["name" ] == "User Content" :
107
113
slog .info ('Found schedule "User Content"' )
114
+ assets_shown = set ()
115
+
116
+ for page in schedule ["pages" ]:
117
+ for tile in page ["tiles" ]:
118
+ if tile ["type" ] in ("image" , "rawvideo" ):
119
+ assets_shown .add (tile ["asset" ])
108
120
109
- if pages != schedule ["pages" ]:
121
+ slog .info (
122
+ "schedule shows assets: {}" .format (
123
+ ", " .join ([str (i ) for i in sorted (assets_shown )])
124
+ )
125
+ )
126
+ if assets_visible != assets_shown :
110
127
schedule ["pages" ] = pages
111
128
setup_changed = True
112
129
0 commit comments