From f03bde7c5036e3594244462df5364f9ff97bd28e Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Sun, 8 Oct 2023 01:16:01 +0200 Subject: [PATCH] Make warning status limited in production / postproduction relationship, if earliest postproduction is before earliest possible production --- src/Checks/Plausi/MDPlausi.php | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/Checks/Plausi/MDPlausi.php b/src/Checks/Plausi/MDPlausi.php index 3853bed..c0e5fed 100644 --- a/src/Checks/Plausi/MDPlausi.php +++ b/src/Checks/Plausi/MDPlausi.php @@ -265,13 +265,13 @@ final class MDPlausi { */ private function _evaluateProductionAfterPostproduction():void { - if ($this->_post_production->earliest_event_type !== 0 + if ($this->_post_production->latest_event_type !== 0 && $this->_production->earliest_event_type !== 0 - && $this->_post_production->earliest < $this->_production->earliest) { + && $this->_post_production->latest < $this->_production->earliest) { - $message = $this->_tlLoader->tl("eventtype_name", "eventname", (string)$this->_post_production->earliest_event_type); + $message = $this->_tlLoader->tl("eventtype_name", "eventname", (string)$this->_post_production->latest_event_type); - $message .= $this->_post_production->formulateMessagePartForEarliest($this->_tlLoader); + $message .= $this->_post_production->formulateMessagePartForLatest($this->_tlLoader); $message .= ' ' . strtolower($this->_tlLoader->tl("quality", "quality", "before")) . ' ' . $this->_tlLoader->tl("eventtype_name", "eventname", (string)$this->_production->earliest_event_type); @@ -282,6 +282,22 @@ final class MDPlausi { } + else if ($this->_post_production->earliest_event_type !== 0 + && $this->_production->earliest_event_type !== 0 + && $this->_post_production->earliest < $this->_production->earliest) { + + $message = $this->_tlLoader->tl("eventtype_name", "eventname", (string)$this->_post_production->earliest_event_type); + + $message .= $this->_post_production->formulateMessagePartForEarliest($this->_tlLoader); + + $message .= ' ' . strtolower($this->_tlLoader->tl("quality", "quality", "before_possibly")) . ' ' . $this->_tlLoader->tl("eventtype_name", "eventname", (string)$this->_production->earliest_event_type); + + $message .= $this->_production->formulateMessagePartForEarliest($this->_tlLoader); + + $this->_messageList[] = $message; + + } + else if ($this->_post_production->earliest_event_type !== 0 && $this->_production->latest_event_type !== 0 && $this->_post_production->earliest < $this->_production->latest) {