mirror of
https://github.com/Kunsi/scheduled-plugin-pretalx-broadcast-tools.git
synced 2025-01-06 15:29:12 +00:00
use OrderedDict for schedule, because order of rooms is important
This commit is contained in:
parent
0206873096
commit
f841594488
1 changed files with 4 additions and 2 deletions
6
service
6
service
|
@ -8,6 +8,8 @@ from datetime import datetime, timedelta
|
||||||
|
|
||||||
import pytz
|
import pytz
|
||||||
from requests import get
|
from requests import get
|
||||||
|
from json import JSONDecoder
|
||||||
|
from collections import OrderedDict
|
||||||
|
|
||||||
from hosted import config, node
|
from hosted import config, node
|
||||||
|
|
||||||
|
@ -146,7 +148,7 @@ def main():
|
||||||
# info json blob atleast once, we have all the information
|
# info json blob atleast once, we have all the information
|
||||||
# we need.
|
# we need.
|
||||||
else:
|
else:
|
||||||
schedule = r.json()
|
schedule = JSONDecoder(object_pairs_hook=OrderedDict).decode(r.text)
|
||||||
tracks = {}
|
tracks = {}
|
||||||
for talk in schedule["talks"]:
|
for talk in schedule["talks"]:
|
||||||
talk["start_str"] = (
|
talk["start_str"] = (
|
||||||
|
@ -177,7 +179,7 @@ def main():
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log("getting schedule.json failed: {}".format(repr(e)))
|
log("getting schedule.json failed: {}".format(repr(e)))
|
||||||
else:
|
else:
|
||||||
raw_schedule = r.json()["schedule"]
|
raw_schedule = JSONDecoder(object_pairs_hook=OrderedDict).decode(r.text)["schedule"]
|
||||||
schedule = {
|
schedule = {
|
||||||
"tracks": raw_schedule["conference"]["tracks"],
|
"tracks": raw_schedule["conference"]["tracks"],
|
||||||
"talks": [],
|
"talks": [],
|
||||||
|
|
Loading…
Reference in a new issue