diff --git a/lib/Controller/ApiController.php b/lib/Controller/ApiController.php index 80d962b6..1fdaba34 100644 --- a/lib/Controller/ApiController.php +++ b/lib/Controller/ApiController.php @@ -89,6 +89,8 @@ class ApiController extends Controller { // Get the folder to show $uid = $this->getUid(); + + // Get the folder to show $folder = null; try { @@ -97,15 +99,10 @@ class ApiController extends Controller return new JSONResponse(['message' => $e->getMessage()], Http::STATUS_NOT_FOUND); } + // Params $recursive = null === $this->request->getParam('folder'); $archive = null !== $this->request->getParam('archive'); - // Remove folder if album - // Permissions will be checked during the transform - if ($this->request->getParam('album')) { - $folder = null; - } - // Run actual query try { $list = $this->timelineQuery->getDays( @@ -172,12 +169,17 @@ class ApiController extends Controller } // Get the folder to show - $folder = $this->getRequestFolder(); + $folder = null; + + try { + $folder = $this->getRequestFolder(); + } catch (\Exception $e) { + return new JSONResponse(['message' => $e->getMessage()], Http::STATUS_NOT_FOUND); + } + + // Params $recursive = null === $this->request->getParam('folder'); $archive = null !== $this->request->getParam('archive'); - if (null === $folder) { - return new JSONResponse([], Http::STATUS_NOT_FOUND); - } // Run actual query try { @@ -825,6 +827,11 @@ class ApiController extends Controller /** Get the Folder object relevant to the request */ private function getRequestFolder() { + // Albums have no folder + if ($this->request->getParam('album')) { + return null; + } + // Public shared folder if ($token = $this->getShareToken()) { $share = $this->shareManager->getShareByToken($token)->getNode(); // throws exception if not found diff --git a/src/components/Timeline.vue b/src/components/Timeline.vue index d64575de..3c2cedb8 100644 --- a/src/components/Timeline.vue +++ b/src/components/Timeline.vue @@ -526,7 +526,6 @@ export default class Timeline extends Mixins(GlobalMixin, UserConfig) { "album", `${this.$route.params.user}/${this.$route.params.name}` ); - query.set("fields", "basename,mimetype"); } // Favorites