Skip to content
This repository was archived by the owner on Oct 13, 2025. It is now read-only.

Commit 6bb77bd

Browse files
committed
Binary url fix
1 parent 88ac3e8 commit 6bb77bd

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

lib/Service/AppDataService.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
use RuntimeException;
3232
use OCP\Files\IAppData;
33+
use OCP\App\IAppManager;
3334
use OCP\Files\NotPermittedException;
3435
use OCP\Files\NotFoundException;
3536
use OCP\IConfig;
@@ -40,6 +41,9 @@ class AppDataService {
4041
/** @var IAppData */
4142
private $appData;
4243

44+
/** @var IAppManager */
45+
private $appManager;
46+
4347
/** @var IConfig */
4448
private $config;
4549

@@ -51,11 +55,13 @@ class AppDataService {
5155

5256
public function __construct(
5357
IAppData $appData,
58+
IAppManager $appManager,
5459
IConfig $config,
5560
UtilsService $utils,
5661
PythonService $pythonService
5762
) {
5863
$this->appData = $appData;
64+
$this->appManager = $appManager;
5965
$this->config = $config;
6066
$this->utils = $utils;
6167
$this->pythonService = $pythonService;
@@ -102,8 +108,9 @@ public function getAppDataFolder(string $folderName): array {
102108
}
103109

104110
public function downloadPythonBinary(bool $update = false) {
105-
$url = 'https://github.com/bigcat88/cpa_py_bundles/releases/download/0.3.0-beta.1/cpa_' .
106-
$this->getBinaryName() . '.gz';
111+
$url = 'https://github.com/andrey18106/mediadc/releases/download/v' .
112+
$this->appManager->getAppVersion(Application::APP_ID)
113+
. ' /cpa_' . $this->getBinaryName() . '.gz';
107114
$binariesFolder = $this->getAppDataFolder('binaries');
108115
if (isset($binariesFolder['success']) && $binariesFolder['success']) {
109116
$dir = $this->getAppDataFolder('binaries')['path'] . '/';

tests/Unit/Service/AppDataServiceTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ class AppDataServiceTest extends TestCase {
4040
/** @var \OCP\Files\IAppData|MockObject */
4141
private $iAppData;
4242

43+
/** @var \OCP\App\IAppManager|MockObject */
44+
private $iAppManager;
45+
4346
/** @var \OCP\IConfig|MockObject */
4447
private $iConfig;
4548

@@ -51,11 +54,13 @@ class AppDataServiceTest extends TestCase {
5154

5255
public function setUp(): void {
5356
$this->iAppData = $this->createMock(\OCP\Files\IAppData::class);
57+
$this->iAppManager = $this->createMock(\OCP\App\IAppManager::class);
5458
$this->iConfig = $this->createMock(\OCP\IConfig::class);
5559
$this->utils = $this->createMock(\OCA\MediaDC\Service\UtilsService::class);
5660
$this->pythonService = $this->createMock(\OCA\MediaDC\Service\PythonService::class);
5761
$this->appDataService = new AppDataService(
5862
$this->iAppData,
63+
$this->iAppManager,
5964
$this->iConfig,
6065
$this->utils,
6166
$this->pythonService

0 commit comments

Comments
 (0)