Add direct deep-link to attachments

This commit is contained in:
Matias De lellis
2020-11-14 00:22:39 -03:00
parent e6653c171f
commit b5dfa7c65d
4 changed files with 44 additions and 10 deletions

View File

@@ -125,8 +125,13 @@ class NoteService {
if (is_null($redirectUrl))
continue;
$deepLinkUrl = $this->fileService->getDeepLinkUrl($attach->getFileId());
if (is_null($deepLinkUrl))
continue;
$attach->setPreviewUrl($previewUrl);
$attach->setRedirectUrl($redirectUrl);
$attach->setDeepLinkUrl($deepLinkUrl);
$rAttachts[] = $attach;
}
@@ -372,6 +377,7 @@ class NoteService {
foreach ($attachts as $attach) {
$attach->setPreviewUrl($this->fileService->getPreviewUrl($attach->getFileId(), 512));
$attach->setRedirectUrl($this->fileService->getRedirectToFileUrl($attach->getFileId()));
$attach->setDeepLinkUrl($this->fileService->getDeepLinkUrl($attach->getFileId()));
}
$newnote->setAttachts($attachts);