Uh oh!
There was an error while loading. Please reload this page.
Feature/files list occ command - #43342
Conversation
…e for files. path or --all is required to search files in the path or based on all users
…se in file info if no files in dir covered
yemkareems
commented
Feb 5, 2024
@AndyScherzinger@sorbaugh Please find the above file list implemented based on files:scan. I am not able add you as reviewers so tagged both of you in the comment here. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Psalm errors fixed Signed-off-by: yemkareems <yemkareems@gmail.com>
composer run cs:fix Signed-off-by: yemkareems <yemkareems@gmail.com>
exectime variable removed to fix psalm error Signed-off-by: yemkareems <yemkareems@gmail.com>
type hinting corrected Signed-off-by: yemkareems <yemkareems@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Scan files replaced with listFiles and all methods refactored accordingly Signed-off-by: yemkareems <yemkareems@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.
path made a argument and user extraction logic based on path changed Signed-off-by: yemkareems <yemkareems@gmail.com>
help doc content changed to start with all first caps Signed-off-by: yemkareems <yemkareems@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| "name" => $node->getName(), | ||
| "size" => $node->getSize() . " bytes", | ||
| "perm" => $node->getPermissions(), | ||
| "owner" => $node->getOwner()->getDisplayName(), |
Check notice
Code scanning / Psalm
PossiblyNullReference
There was a problem hiding this comment.
| "owner" => $node->getOwner()->getDisplayName(), | |
| "owner" => $node->getOwner()?->getDisplayName(), |
Uh oh!
There was an error while loading. Please reload this page.
…hors removed removed the user loop since only one user is there and copy right authors removed Signed-off-by: yemkareems <yemkareems@gmail.com>
type hinting corrected Signed-off-by: yemkareems <yemkareems@gmail.com>
| $this->initTools($output); | ||
| if (is_object($user)) { |
Check notice
Code scanning / Psalm
PossiblyUndefinedVariable
cs fix ran Signed-off-by: yemkareems <yemkareems@gmail.com>
Signed-off-by: yemkareems <yemkareems@gmail.com>
userFolder type hint to fix psalm error Signed-off-by: yemkareems <yemkareems@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Andy Scherzinger <info@andy-scherzinger.de> Signed-off-by: yemkareems <yemkareems@gmail.com>
| ->addArgument( | ||
| "path", | ||
| InputArgument::REQUIRED, | ||
| 'Limit list to this path, eg. path="/alice/files/Music", the user_id is determined by the path parameter' |
There was a problem hiding this comment.
The description no longer matches with it being moved to and argument. (the path=)
There was a problem hiding this comment.
@icewind1991 Updated the description of the path argument
There was a problem hiding this comment.
I mean the path=... doesn't match anymore as it's no longer an option, so you no longer specify the path= part
There was a problem hiding this comment.
Hi @icewind1991 not sure if i understood it correctly because i still do occ files:list path=/admin/files/Media --type=video where path is required and the above lists all the video files in the path
updated the description of path Signed-off-by: yemkareems <yemkareems@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.
making changes to list folders as directory type Signed-off-by: yemkareems <yemkareems@gmail.com>
cs fix run for the file Signed-off-by: yemkareems <yemkareems@gmail.com>
| @@ -0,0 +1,301 @@ | |||
| <?php | |||
| /** | |||
| * @copyright Copyright (c) 2024, ownCloud, Inc. | |||
There was a problem hiding this comment.
| * @copyright Copyright (c) 2024, ownCloud, Inc. | |
| * @copyright Copyright (c) 2024 Kareem <yemkareems@gmail.com> |
| "name" => $node->getName(), | ||
| "size" => $node->getSize() . " bytes", | ||
| "perm" => $node->getPermissions(), | ||
| "owner" => $node->getOwner()->getDisplayName(), |
There was a problem hiding this comment.
| "owner" => $node->getOwner()->getDisplayName(), | |
| "owner" => $node->getOwner()?->getDisplayName(), |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| $files = $userFolder->getDirectoryListing(); | ||
| foreach ($files as $file) { | ||
| $includeType = $includeMin = $includeMax = true; | ||
| $nodeInfo = $this->getNodeInfo($file); |
Check notice
Code scanning / Psalm
ArgumentTypeCoercion
Uh oh!
There was an error while loading. Please reload this page.
artonge
commented
Jul 8, 2024
Closing as it move here: #46352 |
files:list implemented based on files:scan
List of possible usage
all user based search
occ files:list --allpath based search
occ files:list --path /admin/filesscans the directory and sub directory also
Filter by type
Filter by file size
default sort order is desc
occ files:list --all --sort nameto do asc
occ files:list --all --sort name --order ASCNon recursive scan and list
occ files:list --path /admin/files/ --shallowThe above does not scan sub directories recursively
All the above params can be combined to have different result sets
Summary
TODO
Checklist