Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow scanning for metadata with occ scan:file --metadata #32309

Closed
wants to merge 1 commit into from

Conversation

CarlSchwan
Copy link
Member

This is an option since the scanning will take longer with the metadata scanning

Currently, the getNodeForPath function also needs to be fixed since the path manipulation with array_shift shouldn't be required, but I have no idea what to do instead. This was copied from the hookconnector class

@CarlSchwan CarlSchwan added the 2. developing Work in progress label May 9, 2022
@CarlSchwan CarlSchwan force-pushed the feat/allow-scanning-metadata branch from 6a611e3 to b59fd08 Compare May 9, 2022 12:44
// FIXME ugly hack to get it working for local file
array_shift($pathParts);
array_shift($pathParts);
array_shift($pathParts);
Copy link
Member

Choose a reason for hiding this comment

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

I think you can add an argument to explode to only do so for the first three or something and then keep the rest

did you check if using Filesystem::resolvePath would work here ?

Copy link
Member Author

Choose a reason for hiding this comment

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

The issue is that these array_shift shouldn't even exists :( This should work:

 		$info = Filesystem::getFileInfo($path);

Copy link
Member

Choose a reason for hiding this comment

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

iirc $path is absolute here right?

Inject a IRootFolder into the command and use IRootFolder::get instead of using the old static filesystem apis

// FIXME ugly hack to get it working for local file
array_shift($pathParts);
array_shift($pathParts);
array_shift($pathParts);
Copy link
Member

Choose a reason for hiding this comment

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

iirc $path is absolute here right?

Inject a IRootFolder into the command and use IRootFolder::get instead of using the old static filesystem apis

\OC::$server->get(LoggerInterface::class)
);

# check on each file/folder if there was a user interrupt (ctrl-c) and throw an exception

$scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function ($path) use ($output) {
/** @var MetadataManager $metadataManager */
$metadataManager = \OC::$server->get(MetadataManager::class);
Copy link
Member

Choose a reason for hiding this comment

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

Should be injected instead of possible

@matiasdelellis
Copy link

Just testing NC25...
Well, with the new view in the photos app, it should be integrated for that...

@PVince81 PVince81 added this to the Nextcloud 25 milestone Aug 15, 2022
@skjnldsv skjnldsv mentioned this pull request Aug 18, 2022
This was referenced Aug 24, 2022
This was referenced Sep 6, 2022
@skjnldsv skjnldsv mentioned this pull request Sep 15, 2022
This was referenced Sep 20, 2022
@blizzz blizzz modified the milestones: Nextcloud 25, Nextcloud 26 Sep 22, 2022
@PVince81
Copy link
Member

obsoleted by #33511

@PVince81 PVince81 closed this Oct 19, 2022
@skjnldsv skjnldsv deleted the feat/allow-scanning-metadata branch March 14, 2024 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants