mirror of
https://github.com/Kunsi/scheduled-plugin-pretalx-broadcast-tools.git
synced 2024-11-21 17:41:06 +00:00
service: fix tracks display in pretalx-broadcast-tools mode
this fixes #5
This commit is contained in:
parent
d39b59d52e
commit
e2d154226f
1 changed files with 12 additions and 1 deletions
13
service
13
service
|
@ -98,7 +98,7 @@ def main():
|
|||
# we need.
|
||||
else:
|
||||
schedule = r.json()
|
||||
schedule["tracks"] = []
|
||||
tracks = {}
|
||||
for talk in schedule["talks"]:
|
||||
talk["start_str"] = (
|
||||
datetime.fromtimestamp(talk["start_ts"])
|
||||
|
@ -106,6 +106,17 @@ def main():
|
|||
.astimezone(event_tz)
|
||||
.strftime("%H:%M")
|
||||
)
|
||||
if talk["track"]:
|
||||
if talk["track"]["name"] not in tracks:
|
||||
tracks[talk["track"]["name"]] = talk["track"]["color"]
|
||||
schedule["tracks"] = []
|
||||
for name, color in sorted(tracks.items()):
|
||||
schedule["tracks"].append(
|
||||
{
|
||||
"name": name,
|
||||
"color": color,
|
||||
}
|
||||
)
|
||||
node.write_json("schedule.json", schedule)
|
||||
log("updated schedule json")
|
||||
elif config["json_flavour"] == "voc-schema":
|
||||
|
|
Loading…
Reference in a new issue