refactor: fs manager strings
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/672/head
parent
1d1ba59ae2
commit
4bb41d1cc4
|
@ -41,6 +41,8 @@ class DownloadController extends GenericApiController
|
|||
* @UseSession
|
||||
*
|
||||
* Request to download one or more files
|
||||
*
|
||||
* @param mixed $files
|
||||
*/
|
||||
public function request($files): Http\Response
|
||||
{
|
||||
|
|
|
@ -71,7 +71,7 @@ class FsManager
|
|||
$user = $this->userSession->getUser();
|
||||
|
||||
// Albums have no folder
|
||||
if ($this->request->getParam('albums') && Util::albumsIsEnabled()) {
|
||||
if ($this->hasAlbumToken() && Util::albumsIsEnabled()) {
|
||||
if (null !== $user) {
|
||||
return $root;
|
||||
}
|
||||
|
@ -243,7 +243,7 @@ class FsManager
|
|||
{
|
||||
try {
|
||||
// Album share
|
||||
if ($this->request->getParam('albums')) {
|
||||
if ($this->hasAlbumToken()) {
|
||||
$album = $this->albumsQuery->getAlbumByLink($this->getShareToken());
|
||||
if (null === $album) {
|
||||
return null;
|
||||
|
@ -394,6 +394,11 @@ class FsManager
|
|||
return $file;
|
||||
}
|
||||
|
||||
private function hasAlbumToken(): bool
|
||||
{
|
||||
return null !== $this->request->getParam(\OCA\Memories\ClustersBackend\AlbumsBackend::clusterType(), null);
|
||||
}
|
||||
|
||||
private function getShareToken()
|
||||
{
|
||||
return $this->request->getParam('token');
|
||||
|
|
Loading…
Reference in New Issue