Skip to content

Commit

Permalink
Exclude paraclimbing
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoSWD committed Jun 27, 2024
1 parent 2a99ea3 commit db7bd6b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Domain/YouTube/YouTubeLinkMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
}
}
1 change: 1 addition & 0 deletions tests/unit/Domain/YouTube/YouTubeLinkMatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit db7bd6b

Please sign in to comment.