From 9cf8b4acb6bc31e72d8654fc1a37c8fbe5f20b3b Mon Sep 17 00:00:00 2001 From: Ravi Shankar <142860126+RSKSOFFICIAL@users.noreply.github.com> Date: Sun, 30 Aug 2026 12:45:43 +0530 Subject: [PATCH 1/2] fix: log model download URL and destination Signed-off-by: RSKKSOFFICIAL --- lib/Command/DownloadModels.php | 4 +++- lib/Service/DownloadModelsService.php | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/Command/DownloadModels.php b/lib/Command/DownloadModels.php index 7dcafabe5..96d1ff500 100644 --- a/lib/Command/DownloadModels.php +++ b/lib/Command/DownloadModels.php @@ -41,7 +41,9 @@ protected function configure() { */ protected function execute(InputInterface $input, OutputInterface $output): int { try { - $this->downloader->download(); + $this->downloader->download(function (string $message) use ($output): void { + $output->writeln($message); + }); } catch (\Exception $ex) { $output->writeln('Failed to download models'); $output->writeln($ex->getMessage()); diff --git a/lib/Service/DownloadModelsService.php b/lib/Service/DownloadModelsService.php index 64e422382..12dcd7b43 100644 --- a/lib/Service/DownloadModelsService.php +++ b/lib/Service/DownloadModelsService.php @@ -26,9 +26,12 @@ public function __construct(IClientService $clientService, bool $isCLI) { * @return void * @throws \Exception */ - public function download() : void { + public function download(?callable $log = null) : void { + $log ??= static function (string $message): void { + }; $targetPath = __DIR__ . '/../../models'; if (file_exists($targetPath)) { + $log('Removing existing models directory at ' . $targetPath); // remove models directory $it = new RecursiveDirectoryIterator($targetPath, FilesystemIterator::SKIP_DOTS); $files = new RecursiveIteratorIterator($it, @@ -45,8 +48,11 @@ public function download() : void { $archiveUrl = $this->getArchiveUrl($this->getNeededArchiveRef()); $archivePath = __DIR__ . '/../../models.tar.gz'; + $log('Downloading models archive from ' . $archiveUrl); + $log('Saving archive to ' . $archivePath); $timeout = $this->isCLI ? 0 : 480; $this->clientService->newClient()->get($archiveUrl, ['sink' => $archivePath, 'timeout' => $timeout]); + $log('Extracting models to ' . $targetPath); $tarManager = new TAR($archivePath); $tarFiles = $tarManager->getFiles(); $mainFolder = $tarFiles[0]; From 8c095c4a65ff9e8a03f6887025d8ad2dfc38f984 Mon Sep 17 00:00:00 2001 From: Ravi Shankar <142860126+RSKSOFFICIAL@users.noreply.github.com> Date: Wed, 2 Sep 2026 21:05:38 +0530 Subject: [PATCH 2/2] Add log parameter to download method --- lib/Service/DownloadModelsService.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Service/DownloadModelsService.php b/lib/Service/DownloadModelsService.php index 12dcd7b43..17dd8a815 100644 --- a/lib/Service/DownloadModelsService.php +++ b/lib/Service/DownloadModelsService.php @@ -23,6 +23,7 @@ public function __construct(IClientService $clientService, bool $isCLI) { } /** + * @param callable(string): void|null $log * @return void * @throws \Exception */