]> git.localhorst.tv Git - alttp.git/commitdiff
episode do not restream flag
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Mon, 2 Feb 2026 11:48:48 +0000 (12:48 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Mon, 2 Feb 2026 11:48:48 +0000 (12:48 +0100)
app/Console/Commands/SyncHTH.php
app/Models/Episode.php
database/migrations/2026_02_02_114130_episode_do_not_restream.php [new file with mode: 0644]

index 5f8b4be55ad67ebc0bbbb9d394c3bef265d2e5fd..93dd120cfa0ac187268510735116b12fb6f457b8 100644 (file)
@@ -99,6 +99,7 @@ class SyncHTH extends Command {
                                                                                }
                                                                        }
                                                                }
+                                                               restreamConsent
                                                                restreamUrls {
                                                                        url
                                                                        language
@@ -143,6 +144,8 @@ class SyncHTH extends Command {
                if (!$episode) {
                        $episode = new Episode();
                        $episode->ext_id = $ext_id;
+                       $episode->estimate = 120 * 60;
+                       $episode->confirmed = true;
                }
                $episode->event()->associate($event);
                $episode->title = $hthEntry['phase'].' '.$hthEntry['round'];
@@ -153,11 +156,12 @@ class SyncHTH extends Command {
                if (!$episode->start || $start->ne($episode->start)) {
                        $episode->start = $start;
                }
-               $episode->estimate = 120 * 60;
-               $episode->confirmed = true;
                if ($hthEntry['room']) {
                        $episode->raceroom = $hthEntry['room'];
                }
+               if (!$hthEntry['restreamConsent']) {
+                       $episode->do_not_restream = false;
+               }
                $episode->save();
 
                $this->purgePlayers($episode, $hthEntry);
index 67114c78cf84d0687f5dbc28bbac047bc55802d7..611a69c9103eb4faf2fba61eb7cb0491ab846b11 100644 (file)
@@ -175,6 +175,7 @@ class Episode extends Model
        protected $casts = [
                'confirmed' => 'boolean',
                'create_raceroom' => 'boolean',
+               'do_not_restream' => 'boolean',
                'start' => 'datetime',
        ];
 
diff --git a/database/migrations/2026_02_02_114130_episode_do_not_restream.php b/database/migrations/2026_02_02_114130_episode_do_not_restream.php
new file mode 100644 (file)
index 0000000..8e4d628
--- /dev/null
@@ -0,0 +1,28 @@
+<?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('episodes', function (Blueprint $table) {
+                       $table->boolean('do_not_restream')->default(false);
+               });
+       }
+
+       /**
+        * Reverse the migrations.
+        */
+       public function down(): void
+       {
+               Schema::table('episodes', function (Blueprint $table) {
+                       $table->dropColumn('do_not_restream');
+               });
+       }
+};