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
|
* @UseSession
|
||||||
*
|
*
|
||||||
* Request to download one or more files
|
* Request to download one or more files
|
||||||
|
*
|
||||||
|
* @param mixed $files
|
||||||
*/
|
*/
|
||||||
public function request($files): Http\Response
|
public function request($files): Http\Response
|
||||||
{
|
{
|
||||||
|
|
|
@ -71,7 +71,7 @@ class FsManager
|
||||||
$user = $this->userSession->getUser();
|
$user = $this->userSession->getUser();
|
||||||
|
|
||||||
// Albums have no folder
|
// Albums have no folder
|
||||||
if ($this->request->getParam('albums') && Util::albumsIsEnabled()) {
|
if ($this->hasAlbumToken() && Util::albumsIsEnabled()) {
|
||||||
if (null !== $user) {
|
if (null !== $user) {
|
||||||
return $root;
|
return $root;
|
||||||
}
|
}
|
||||||
|
@ -243,7 +243,7 @@ class FsManager
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
// Album share
|
// Album share
|
||||||
if ($this->request->getParam('albums')) {
|
if ($this->hasAlbumToken()) {
|
||||||
$album = $this->albumsQuery->getAlbumByLink($this->getShareToken());
|
$album = $this->albumsQuery->getAlbumByLink($this->getShareToken());
|
||||||
if (null === $album) {
|
if (null === $album) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -394,6 +394,11 @@ class FsManager
|
||||||
return $file;
|
return $file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function hasAlbumToken(): bool
|
||||||
|
{
|
||||||
|
return null !== $this->request->getParam(\OCA\Memories\ClustersBackend\AlbumsBackend::clusterType(), null);
|
||||||
|
}
|
||||||
|
|
||||||
private function getShareToken()
|
private function getShareToken()
|
||||||
{
|
{
|
||||||
return $this->request->getParam('token');
|
return $this->request->getParam('token');
|
||||||
|
|
Loading…
Reference in New Issue