]> git.localhorst.tv Git - alttp.git/commitdiff
prevent pushing events from the past
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Fri, 11 Jul 2025 13:17:08 +0000 (15:17 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Fri, 11 Jul 2025 13:17:08 +0000 (15:17 +0200)
app/Console/Commands/DiscordEpisodeSubscriptionsCommand.php

index 0ae19e938627030668dc7250c531bf6978f7be6d..c6631630c6431bdd00afb7a3de9b5e4b6aab2914 100644 (file)
@@ -93,7 +93,7 @@ class DiscordEpisodeSubscriptionsCommand extends Command
                        }
                }
                $memo = $this->getMemo($guild, $episode);
-               if (is_null($memo->synced_at) || $memo->synced_at < $mtime) {
+               if ((is_null($memo->synced_at) && $episode->start < now()) || $memo->synced_at < $mtime) {
                        $this->line('pushing '.$episode->id.' '.$episode->getScheduledEventName());
                        DiscordBotCommand::episodeEvent($guild, $episode);
                }