Skip to content

Commit

Permalink
TTK-26902 check if account used exists on PuMuKIT DB
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurujai committed Mar 8, 2024
1 parent df3770f commit dbfce2f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Command/DownloadVideosFromYouTubeChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$channel = $input->getOption('channel');
$limit = (int) $input->getOption('limit');

$youtubeAccount = $this->ensureYouTubeAccountExists($input);
$this->ensureYouTubeAccountExists($input);

$multimediaObjects = $this->documentManager->getRepository(MultimediaObject::class)->findBy([
'status' => ['$in' => [MultimediaObject::STATUS_PUBLISHED, MultimediaObject::STATUS_HIDDEN]],
Expand Down Expand Up @@ -193,7 +193,7 @@ private function createChannelDir(string $channelId): void
}
}

private function ensureYouTubeAccountExists(InputInterface $input): Tag
private function ensureYouTubeAccountExists(InputInterface $input): void
{
$youtubeAccount = $this->documentManager->getRepository(Tag::class)->findOneBy([
'properties.login' => $input->getOption('account'),
Expand All @@ -202,8 +202,6 @@ private function ensureYouTubeAccountExists(InputInterface $input): Tag
if (!$youtubeAccount) {
throw new \Exception('Account not found');
}

return $youtubeAccount;
}

}

0 comments on commit dbfce2f

Please sign in to comment.