$validatedData = $request->validate([
'after' => 'nullable|date',
'before' => 'nullable|date',
+ 'create_raceroom' => 'boolean',
'event' => 'nullable|array',
'event.*' => 'numeric',
'eventInvert' => 'boolean',
if (isset($validatedData['before'])) {
$episodes = $episodes->where('episodes.start', '<=', $validatedData['before']);
}
+ if (isset($validatedData['create_raceroom'])) {
+ if ($validatedData['create_raceroom']) {
+ $episodes->where(DB::raw('COALESCE(`episodes`.`create_raceroom`, `events`.`create_raceroom`)'), '!=', '0');
+ } else {
+ $episodes->where(DB::raw('COALESCE(`episodes`.`create_raceroom`, `events`.`create_raceroom`)'), '=', '0');
+ }
+ }
if (!$this->userMaySeeAllEvents($request)) {
$privIDs = $this->getUserPrivilegedEvents($request);
if (!empty($privIDs)) {
protected $casts = [
'confirmed' => 'boolean',
+ 'create_raceroom' => 'boolean',
'start' => 'datetime',
];
}
protected $casts = [
+ 'create_raceroom' => 'boolean',
'end' => 'datetime',
'start' => 'datetime',
'visible' => 'boolean',
--- /dev/null
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+ /**
+ * Run the migrations.
+ */
+ public function up(): void
+ {
+ Schema::table('events', function (Blueprint $table) {
+ $table->boolean('create_raceroom')->default(false);
+ $table->unsignedInteger('raceroom_lead_time')->default(30 * 60);
+ });
+ Schema::table('episodes', function (Blueprint $table) {
+ $table->string('create_raceroom')->nullable()->default(null);
+ $table->string('raceroom_lead_time')->nullable()->default(null);
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void
+ {
+ Schema::table('events', function (Blueprint $table) {
+ $table->dropColumn('create_raceroom');
+ $table->dropColumn('raceroom_lead_time');
+ });
+ Schema::table('episodes', function (Blueprint $table) {
+ $table->dropColumn('create_raceroom');
+ $table->dropColumn('raceroom_lead_time');
+ });
+ }
+};
# Public API
+GET parameters:
+multivalued parameters use the PHP bracket notation, e.g. event%5B%5D=2&event%5B%5D=5
+datetime values use ISO notation, e.g. 2025-10-16T22:00:00.000000Z
+booleans are encoded as "0" or "1"
+
+Responses:
+200 Responses will have a JSON encoded Object or Array as body
+other responses will communicate their intent via status code, most will also have boilerplate HTML bodies
+
## Base URI
https://alttp.localhorst.tv/api
Parameters:
- after: Date
- before: Date
+- create_raceroom: Boolean
- event[]: Integer
- eventInvert: Boolean; switches event[] to exclusion filter
- game[]: String
- channels: Array of Channel objects
- comment: String; supplementary information, may be empty, not localised
- confirmed: Boolean
+- create_raceroom: Boolean or null; if null, use event's prop instead
- crew: Array of EpisodeCrew objects
- estimate: Integer; approximate runtime in seconds
- event: Object of type Event
- id: Integer
- players: Array of EpisodePlayer objects; with user if available
- raceroom: String or null; URL of race room if available
+- raceroom_lead_time: Integer or null; in seconds. if null, use event's prop instead
- start: Date; includes delay, if any
- title: String
Response: Array of Event objects with following fields:
- banner: String; host-relative URL to banner image (discord event layout) or empty
- corner: String; host-relative URL to corner image (bottom left background) or empty
+- create_raceroom: Boolean
- description: optional object of type Content or null; only present if with[]=description was requested, may be null if event has no description
- end: Date or null
- external_schedule: String or null; if externally managed, this contains the reference
- game: String or null
- id: Integer
- name: String
+- raceroom_lead_time: Integer; in seconds
- racetime_category: String or null
- short: String; shorter version of title, may be empty
- start: Date or null