From: Daniel Karbach Date: Sun, 12 Mar 2023 17:35:23 +0000 (+0100) Subject: manual tz fix override X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=94268534de35c414d4c76ccdf7d46ed7a5308693;p=alttp.git manual tz fix override --- diff --git a/app/Console/Commands/SyncSpeedGaming.php b/app/Console/Commands/SyncSpeedGaming.php index ea09839..95304c3 100644 --- a/app/Console/Commands/SyncSpeedGaming.php +++ b/app/Console/Commands/SyncSpeedGaming.php @@ -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 index 0000000..b008a4b --- /dev/null +++ b/database/migrations/2023_03_12_173315_tz_fix_override.php @@ -0,0 +1,32 @@ +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'); + }); + } +};