Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions js/photos-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/photos-main.js.map

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions lib/Controller/AlbumsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\JSONResponse;
use OCP\Constants;
use OCP\Files\File;
use OCP\Files\Folder;
use OCP\Files\IRootFolder;
Expand Down Expand Up @@ -109,13 +110,36 @@ private function formatData(iterable $nodes): array {
'mime' => $node->getMimetype(),
'size' => $node->getSize(),
'type' => $node->getType(),
'permissions' => $this->formatPermissions($node->getPermissions()),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, and this is not the albums controller but the folders controller, probably, then we may need this for the actual albums as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, but the other Views are importing src/services/DavRequest.js, so they will benefit from that too

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but Albums and Faces dav endpoints do not expose permissions in DAV afaik

'hasPreview' => $this->previewManager->isAvailable($node),
];
}

return $result;
}

private function formatPermissions(int $permissions): string {
$strPermissions = '';
if ($permissions) {
if ($permissions & Constants::PERMISSION_CREATE) {
$strPermissions .= 'CK';
}
if ($permissions & Constants::PERMISSION_READ) {
$strPermissions .= 'G';
}
if ($permissions & Constants::PERMISSION_UPDATE) {
$strPermissions .= 'W';
}
if ($permissions & Constants::PERMISSION_DELETE) {
$strPermissions .= 'D';
}
if ($permissions & Constants::PERMISSION_SHARE) {
$strPermissions .= 'R';
}
}
return $strPermissions;
}

private function scanCurrentFolder(Folder $folder, bool $shared): iterable {
$nodes = $folder->getDirectoryListing();

Expand Down
18 changes: 10 additions & 8 deletions src/services/DavRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,19 @@
*
*/
const props = `
<oc:fileid />
<d:getlastmodified />
<d:getetag />
<d:getcontenttype />
<d:getcontentlength />
<nc:realpath />
<nc:has-preview />
<nc:file-metadata-size />
<d:getcontenttype />
<d:getetag />
<d:getlastmodified />
<d:resourcetype />
<nc:face-detections />
<nc:file-metadata-size />
<nc:has-preview />
<nc:realpath />
<oc:favorite />
<d:resourcetype />`
<oc:fileid />
<oc:permissions />
`
Comment on lines +24 to +35
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for the reordering ? just curious :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to mess with us :D

Copy link
Member Author

@skjnldsv skjnldsv Sep 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorting alphabetically. Easier to find what you want


export { props }
export default `<?xml version="1.0"?>
Expand Down