diff --git a/lib/Db/SwarmFile.php b/lib/Db/SwarmFile.php index 88fe1af..70056b9 100755 --- a/lib/Db/SwarmFile.php +++ b/lib/Db/SwarmFile.php @@ -26,8 +26,6 @@ use OCP\AppFramework\Db\Entity; /** - * @method void setFileId(int $fileId) - * @method int getFileId() * @method void setName(string $name) * @method string getName() * @method void setSwarmReference(string $swarmReference) @@ -50,9 +48,6 @@ * @method int getToken() */ class SwarmFile extends Entity { - /** @var null|int */ - protected $fileId; - /** @var string */ protected $name; @@ -84,7 +79,6 @@ class SwarmFile extends Entity { protected $token; public function __construct() { - $this->addType('fileId', 'int'); $this->addType('name', 'string'); $this->addType('swarmReference', 'string'); $this->addType('swarmTag', 'string'); diff --git a/lib/Db/SwarmFileMapper.php b/lib/Db/SwarmFileMapper.php index 6f140c4..8099c25 100755 --- a/lib/Db/SwarmFileMapper.php +++ b/lib/Db/SwarmFileMapper.php @@ -44,13 +44,13 @@ public function __construct(IDBConnection $db) { /** * @throws Exception */ - public function findByFileId(string $fileId): ?SwarmFile { + public function findById(string $id): ?SwarmFile { $qb = $this->db->getQueryBuilder(); $select = $qb ->select('*') ->from($this->getTableName()) - ->where($qb->expr()->eq('fileId', $qb->createNamedParameter($fileId))) + ->where($qb->expr()->eq('id', $qb->createNamedParameter($id))) ; return $this->findEntities($select)[0] ?? null; diff --git a/lib/Service/EthswarmService.php b/lib/Service/EthswarmService.php index dcb466a..7b4bc15 100755 --- a/lib/Service/EthswarmService.php +++ b/lib/Service/EthswarmService.php @@ -74,8 +74,8 @@ public function setVisibility(string $fileName, int $storageId, int $visibility) return $this->fileMapper->update($swarmFile); } - public function getToken(string $fileId): string { - $swarmFile = $this->fileMapper->findByFileId($fileId); + public function getToken(string $id): string { + $swarmFile = $this->fileMapper->findById($id); if (!$swarmFile) { throw new StorageNotAvailableException($this->l10n->t('No token found')); } diff --git a/lib/Storage/BeeSwarm.php b/lib/Storage/BeeSwarm.php index d5a8696..88cbe46 100755 --- a/lib/Storage/BeeSwarm.php +++ b/lib/Storage/BeeSwarm.php @@ -158,7 +158,7 @@ public function copy($source, $target): bool { try { // Get the source file from the mapper $sourceFile = $this->fileMapper->find($source, $this->storageId); - if (!$sourceFile->getFileId()) { + if (!$sourceFile->getId()) { $this->logger->error( 'copy failed: source file not found in mapper '.$source, ['app' => Application::NAME] @@ -177,11 +177,12 @@ public function copy($source, $target): bool { $copyData['storage_mtime'] = time(); $copyData['storage'] = $this->storageId; $copyData['token'] = $this->token; + $copyData['visibility'] = $sourceFile->getVisibility(); // Create the new file entry in the mapper $newFile = $this->fileMapper->createFile($copyData); - if (!$newFile->getFileId()) { + if (!$newFile->getId()) { $this->logger->error( 'copy failed: failed to create new file in mapper '.$target, ['app' => Application::NAME] diff --git a/vendor-bin/sentry/composer.lock b/vendor-bin/sentry/composer.lock index a5b1411..5c56448 100644 --- a/vendor-bin/sentry/composer.lock +++ b/vendor-bin/sentry/composer.lock @@ -386,16 +386,16 @@ }, { "name": "sentry/sentry", - "version": "4.13.0", + "version": "4.14.0", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-php.git", - "reference": "b54a0eaedfc27fc2da587e64455a66cd29cd3c4d" + "reference": "f8c50304bd2f1640704345274bdd5af150b6945d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/b54a0eaedfc27fc2da587e64455a66cd29cd3c4d", - "reference": "b54a0eaedfc27fc2da587e64455a66cd29cd3c4d", + "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/f8c50304bd2f1640704345274bdd5af150b6945d", + "reference": "f8c50304bd2f1640704345274bdd5af150b6945d", "shasum": "" }, "require": { @@ -459,7 +459,7 @@ ], "support": { "issues": "https://github.com/getsentry/sentry-php/issues", - "source": "https://github.com/getsentry/sentry-php/tree/4.13.0" + "source": "https://github.com/getsentry/sentry-php/tree/4.14.0" }, "funding": [ { @@ -471,7 +471,7 @@ "type": "custom" } ], - "time": "2025-06-10T15:39:27+00:00" + "time": "2025-06-13T17:22:57+00:00" }, { "name": "symfony/deprecation-contracts",