diff --git a/src/Domain/YouTube/YouTubeLinkMatcher.php b/src/Domain/YouTube/YouTubeLinkMatcher.php index e4bb8bd..aac78c2 100644 --- a/src/Domain/YouTube/YouTubeLinkMatcher.php +++ b/src/Domain/YouTube/YouTubeLinkMatcher.php @@ -50,13 +50,13 @@ private function videoTitleMatchesRoundName(YouTubeVideo $video, string $roundNa $videoTags = $this->fetchTagsFromTitle($videoTitle); - if ($this->videoIsHighlights($videoTags)) { + if ($this->videoIsHighlights($videoTags) || $this->videoIsParaclimbing($videoTags)) { return false; } $eventTags = $this->fetchTagsFromTitle($roundName); - if ($this->videoIsMensAndWomensCombined($videoTags, $eventTags) || $this->videoIsParaclimbing($eventTags)) { + if ($this->videoIsMensAndWomensCombined($videoTags, $eventTags)) { return true; } @@ -128,8 +128,8 @@ private function eventSeason(IFSCEventInfo $event): string return (new DateTimeImmutable($event->localStartDate))->format('Y'); } - private function videoIsParaclimbing(array $eventTags): bool + private function videoIsParaclimbing(array $videoTags): bool { - return $this->hasTag($eventTags, Tag::PARACLIMBING); + return $this->hasTag($videoTags, Tag::PARACLIMBING); } } diff --git a/tests/unit/Domain/YouTube/YouTubeLinkMatcherTest.php b/tests/unit/Domain/YouTube/YouTubeLinkMatcherTest.php index 752317c..9906546 100644 --- a/tests/unit/Domain/YouTube/YouTubeLinkMatcherTest.php +++ b/tests/unit/Domain/YouTube/YouTubeLinkMatcherTest.php @@ -124,6 +124,7 @@ final class YouTubeLinkMatcherTest extends TestCase private function createVideoCollection(): YouTubeVideoCollection { $titles = [ + "n6YyV2ddb00" => "Paraclimbing Speed qualification || Salt Lake City 2023", "n6YyV2ddbb4" => "Women's Speed qualification || Salt Lake City 2023", "emrHdLsJTk5" => "Men's Boulder qualification highlights || Seoul 2023", "emrHdLsJTk4" => "IFSC World Cup Seoul 2023 || Men's qualification review",