[URGENT] [TBR] Restructure concert schema
- Add hasTimes field to concerts in the JSON schema
- Adds begins field to songs in the JSON schema
- Shows these times in the frontend
- Shows a warning message about the concert cancelation and the virtual
concert planing
- Add CLI tool to get songs by person (tools/list.php)
Change-Id: Iec80ceb69e1a45cd467aaeaa59337a9966c78b7c
diff --git a/tools/list.php b/tools/list.php
new file mode 100644
index 0000000..8ea32ab
--- /dev/null
+++ b/tools/list.php
@@ -0,0 +1,21 @@
+<?php
+$rawJson = file_get_contents("php://stdin");
+$json = json_decode($rawJson, true);
+
+$students = [];
+foreach ($json['songs'] as $song) {
+ foreach ($song["performers"] as $instrument) {
+ foreach ($instrument['names'] as $s) {
+ if (!isset($students[$s])) $students[$s] = [];
+ $students[$s][] = $song;
+ }
+ }
+}
+
+foreach ($students as $s => $songs) {
+ echo '==='.$s.'==='.PHP_EOL;
+ foreach ($songs as $song) {
+ echo ' - '.$song['begins'].' '.$song['title'].' '.PHP_EOL;
+ }
+ echo PHP_EOL;
+}