mirror of
https://github.com/Kunsi/scheduled-plugin-pretalx-broadcast-tools.git
synced 2025-05-09 06:34:06 +00:00
add option to use room uuid instead of room name
This commit is contained in:
parent
927adfa0da
commit
cc8bcc1233
3 changed files with 13 additions and 3 deletions
10
service
10
service
|
@ -91,10 +91,13 @@ def main():
|
|||
else:
|
||||
event_info = r.json()
|
||||
|
||||
room_uuid_mapping = {}
|
||||
if event_info is not None:
|
||||
event_start = datetime.strptime(event_info["start"], "%Y-%m-%d")
|
||||
event_end = datetime.strptime(event_info["end"], "%Y-%m-%d")
|
||||
event_tz = pytz.timezone(event_info["timezone"])
|
||||
for uuid, room_name in event_info.get("rooms", {}).items():
|
||||
room_uuid_mapping[room_name] = uuid
|
||||
|
||||
try:
|
||||
r = get(
|
||||
|
@ -116,6 +119,7 @@ def main():
|
|||
.astimezone(event_tz)
|
||||
.strftime("%H:%M")
|
||||
)
|
||||
talk["room_uuid"] = room_uuid_mapping.get("room")
|
||||
if talk["track"]:
|
||||
if talk["track"]["name"] not in tracks:
|
||||
tracks[talk["track"]["name"]] = talk["track"]["color"]
|
||||
|
@ -142,6 +146,10 @@ def main():
|
|||
"talks": [],
|
||||
}
|
||||
|
||||
room_uuid_mapping = {}
|
||||
for room in raw_schedule["conference"]["rooms"]:
|
||||
room_uuid_mapping[room["name"]] = room["guid"]
|
||||
|
||||
event_start = datetime.strptime(
|
||||
raw_schedule["conference"]["start"][:10], "%Y-%m-%d"
|
||||
)
|
||||
|
@ -183,6 +191,8 @@ def main():
|
|||
break
|
||||
talk["track"] = track
|
||||
|
||||
talk["room_uuid"] = room_uuid_mapping.get(talk["room"])
|
||||
|
||||
persons = []
|
||||
for p in talk["persons"]:
|
||||
name = p.get("public_name", p.get("name"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue