Remove album folder in day call

old-stable24^2
Varun Patil 2022-10-28 22:44:16 -07:00
parent 80f6a491d2
commit 7dd758ee4d
2 changed files with 17 additions and 11 deletions

View File

@ -89,6 +89,8 @@ class ApiController extends Controller
{ {
// Get the folder to show // Get the folder to show
$uid = $this->getUid(); $uid = $this->getUid();
// Get the folder to show
$folder = null; $folder = null;
try { try {
@ -97,15 +99,10 @@ class ApiController extends Controller
return new JSONResponse(['message' => $e->getMessage()], Http::STATUS_NOT_FOUND); return new JSONResponse(['message' => $e->getMessage()], Http::STATUS_NOT_FOUND);
} }
// Params
$recursive = null === $this->request->getParam('folder'); $recursive = null === $this->request->getParam('folder');
$archive = null !== $this->request->getParam('archive'); $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 // Run actual query
try { try {
$list = $this->timelineQuery->getDays( $list = $this->timelineQuery->getDays(
@ -172,12 +169,17 @@ class ApiController extends Controller
} }
// Get the folder to show // 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'); $recursive = null === $this->request->getParam('folder');
$archive = null !== $this->request->getParam('archive'); $archive = null !== $this->request->getParam('archive');
if (null === $folder) {
return new JSONResponse([], Http::STATUS_NOT_FOUND);
}
// Run actual query // Run actual query
try { try {
@ -825,6 +827,11 @@ class ApiController extends Controller
/** Get the Folder object relevant to the request */ /** Get the Folder object relevant to the request */
private function getRequestFolder() private function getRequestFolder()
{ {
// Albums have no folder
if ($this->request->getParam('album')) {
return null;
}
// Public shared folder // Public shared folder
if ($token = $this->getShareToken()) { if ($token = $this->getShareToken()) {
$share = $this->shareManager->getShareByToken($token)->getNode(); // throws exception if not found $share = $this->shareManager->getShareByToken($token)->getNode(); // throws exception if not found

View File

@ -526,7 +526,6 @@ export default class Timeline extends Mixins(GlobalMixin, UserConfig) {
"album", "album",
`${this.$route.params.user}/${this.$route.params.name}` `${this.$route.params.user}/${this.$route.params.name}`
); );
query.set("fields", "basename,mimetype");
} }
// Favorites // Favorites