diff --git a/lib/BackgroundJobs/IndexerJob.php b/lib/BackgroundJobs/IndexerJob.php index 632793f..cd1c00c 100644 --- a/lib/BackgroundJobs/IndexerJob.php +++ b/lib/BackgroundJobs/IndexerJob.php @@ -233,7 +233,7 @@ protected function index(array $files): void { $sources[] = new Source( $userIds, ProviderConfigService::getSourceId($file->getId()), - $file->getInternalPath(), + $file->getInternalPath() ?: $file->getPath() ?: $file->getName(), $fileHandle, $file->getMtime(), $file->getMimeType(), diff --git a/lib/Service/ScanService.php b/lib/Service/ScanService.php index 70406d7..9628859 100644 --- a/lib/Service/ScanService.php +++ b/lib/Service/ScanService.php @@ -114,7 +114,7 @@ public function getSourceFromFile(array $mimeTypeFilter, File $node): ?Source { $providerKey = ProviderConfigService::getDefaultProviderKey(); $sourceId = ProviderConfigService::getSourceId($node->getId()); $userIds = $this->storageService->getUsersForFileId($node->getId()); - $path = $node->getInternalPath(); + $path = $node->getInternalPath() ?: $node->getPath() ?: $node->getName(); return new Source( $userIds, $sourceId,