]> git.localhorst.tv Git - alttp.git/commitdiff
manual tz fix override
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Sun, 12 Mar 2023 17:35:23 +0000 (18:35 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Sun, 12 Mar 2023 17:35:23 +0000 (18:35 +0100)
app/Console/Commands/SyncSpeedGaming.php
database/migrations/2023_03_12_173315_tz_fix_override.php [new file with mode: 0644]

index ea098391046d898a16099452958c2551414b4d59..95304c318453a81502c1df45705d32736a141079 100644 (file)
@@ -104,7 +104,7 @@ class SyncSpeedGaming extends Command {
                $episode->event()->associate($event);
                $episode->title = $sgEntry['match1']['title'];
                $start = Carbon::createFromFormat('Y-m-d\TH:i:sP', $sgEntry['when']);
-               if ($event->fix_timezone) {
+               if ($event->fix_timezone && !$episode->timezone_fix_override) {
                        $sg_zone = new \DateTimeZone('America/Chicago');
                        $event_zone = new \DateTimeZone($event->fix_timezone);
                        // if speedgaming is in DST, it fucks up the timestamp
diff --git a/database/migrations/2023_03_12_173315_tz_fix_override.php b/database/migrations/2023_03_12_173315_tz_fix_override.php
new file mode 100644 (file)
index 0000000..b008a4b
--- /dev/null
@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+       /**
+        * Run the migrations.
+        *
+        * @return void
+        */
+       public function up()
+       {
+               Schema::table('episodes', function(Blueprint $table) {
+                       $table->boolean('timezone_fix_override')->default(false);
+               });
+       }
+
+       /**
+        * Reverse the migrations.
+        *
+        * @return void
+        */
+       public function down()
+       {
+               Schema::table('episodes', function(Blueprint $table) {
+                       $table->dropColumn('timezone_fix_override');
+               });
+       }
+};