From 9d2b43e443e2658bdab4b6c35cb6e202749c1886 Mon Sep 17 00:00:00 2001 From: Andreas Hubel Date: Fri, 22 Dec 2023 23:04:50 +0100 Subject: [PATCH 1/2] feat: add additional flag for do_not_stream / recording optout enum --- validator/json/schema.json | 6 ++++-- validator/xsd/schedule.xml.xsd | 15 ++++++++++++++- voc/schedule.py | 5 ++++- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/validator/json/schema.json b/validator/json/schema.json index 6557768..0286de9 100644 --- a/validator/json/schema.json +++ b/validator/json/schema.json @@ -266,10 +266,12 @@ "type": "string" }, "do_not_record": { - "type": ["boolean", "null"] + "type": ["boolean", "string", "null"], + "description": "If this value is set to `true`, the speaker does not want a recording of any kind. We will remove all video staff and maybe even switch off all cameras" }, "do_not_stream": { - "type": ["string", "null"] + "type": ["string", "boolean", "null"], + "description": "If this value is set to boolean `false`, the speaker is okay with a live stream of the event; and is aware that somebody in the internet might create third party recording" }, "persons": { "type": "array", diff --git a/validator/xsd/schedule.xml.xsd b/validator/xsd/schedule.xml.xsd index 8a19a8a..3155d55 100644 --- a/validator/xsd/schedule.xml.xsd +++ b/validator/xsd/schedule.xml.xsd @@ -173,7 +173,7 @@ - + @@ -242,4 +242,17 @@ + + + + + + + + + + + + + diff --git a/voc/schedule.py b/voc/schedule.py index 88d18dc..7b0d6ef 100644 --- a/voc/schedule.py +++ b/voc/schedule.py @@ -500,6 +500,9 @@ def add_events_from(self, other_schedule, id_offset=None, options={}, context: E if options.get("do_not_record"): event["do_not_record"] = options['do_not_record'](event) if callable(options["do_not_record"]) else options["do_not_record"] + if options.get("do_not_stream"): + event["do_not_stream"] = options['do_not_stream'](event) if callable(options["do_not_stream"]) else options["do_not_stream"] + if options.get("remove_title_additions"): # event["title"], subtitle, event_type = re.match(r"^(.{15,}?)(?:(?::| [–-]+) (.+?))?(?: \((.+?)\))?$", event["title"]).groups() @@ -698,7 +701,7 @@ def _to_etree(d, node, parent=""): # not in schedule.json: license information for an event v = { "license": recording_license, - "optout": "true" if v is True else "false", + "optout": "true" if v is True else v, } # new style schedule.json (version 2022-12) elif k == "optout": From db9b6b27b27030e619a59e34d0fefd4091b2248e Mon Sep 17 00:00:00 2001 From: Andreas Hubel <40266+saerdnaer@users.noreply.github.com> Date: Wed, 3 Jan 2024 22:35:53 +0100 Subject: [PATCH 2/2] Apply suggestions from code review --- validator/xsd/schedule.xml.xsd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validator/xsd/schedule.xml.xsd b/validator/xsd/schedule.xml.xsd index 3155d55..4a65d1b 100644 --- a/validator/xsd/schedule.xml.xsd +++ b/validator/xsd/schedule.xml.xsd @@ -250,7 +250,7 @@ - +