mirror of
https://github.com/Kunsi/scheduled-plugin-pretalx-broadcast-tools.git
synced 2025-01-04 22:39:12 +00:00
sort talks in python, only sort by time
this assumes the room order in the schedule.json is the correct order
This commit is contained in:
parent
e198f6351f
commit
0ff25fb301
3 changed files with 2 additions and 13 deletions
6
node.lua
6
node.lua
|
@ -96,12 +96,6 @@ local function check_next_talks()
|
||||||
all_next_talks[#all_next_talks+1] = talk
|
all_next_talks[#all_next_talks+1] = talk
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function sort_talks(a, b)
|
|
||||||
return a.start_ts < b.start_ts or (a.start_ts == b.start_ts and a.room < b.room)
|
|
||||||
end
|
|
||||||
|
|
||||||
table.sort(all_next_talks, sort_talks)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function wrap(str, font, size, max_w)
|
local function wrap(str, font, size, max_w)
|
||||||
|
|
2
service
2
service
|
@ -151,6 +151,7 @@ def main():
|
||||||
"color": color,
|
"color": color,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
schedule["talks"] = sorted(schedule["talks"], key=lambda t: t["start_ts"])
|
||||||
node.write_json("schedule.json", schedule)
|
node.write_json("schedule.json", schedule)
|
||||||
log("updated schedule json")
|
log("updated schedule json")
|
||||||
elif config["json_flavour"] == "voc-schema":
|
elif config["json_flavour"] == "voc-schema":
|
||||||
|
@ -236,6 +237,7 @@ def main():
|
||||||
talk["persons"] = persons
|
talk["persons"] = persons
|
||||||
|
|
||||||
schedule["talks"].append(talk)
|
schedule["talks"].append(talk)
|
||||||
|
schedule["talks"] = sorted(schedule["talks"], key=lambda t: t["start_ts"])
|
||||||
node.write_json("schedule.json", schedule)
|
node.write_json("schedule.json", schedule)
|
||||||
log("updated schedule json")
|
log("updated schedule json")
|
||||||
else:
|
else:
|
||||||
|
|
7
tile.lua
7
tile.lua
|
@ -151,13 +151,6 @@ local function check_next_talks()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function sort_talks(a, b)
|
|
||||||
return a.start_ts < b.start_ts or (a.start_ts == b.start_ts and a.room < b.room)
|
|
||||||
end
|
|
||||||
|
|
||||||
table.sort(room_next_talks, sort_talks)
|
|
||||||
table.sort(all_next_talks, sort_talks)
|
|
||||||
|
|
||||||
log(tostring(#all_next_talks) .. " talks to come")
|
log(tostring(#all_next_talks) .. " talks to come")
|
||||||
log(tostring(#room_next_talks) .. " in this room")
|
log(tostring(#room_next_talks) .. " in this room")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue