Skip to content

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

Closed
CarlSchwan wants to merge 1 commit into
masterfrom
feat/allow-scanning-metadata
Closed

Allow scanning for metadata with occ scan:file --metadata#32309
CarlSchwan wants to merge 1 commit into
masterfrom
feat/allow-scanning-metadata

Conversation

@CarlSchwan

Copy link
Copy Markdown
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

@CarlSchwanCarlSchwan added the 2. developing Work in progress label May 9, 2022
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
@CarlSchwan
CarlSchwanforce-pushed the feat/allow-scanning-metadata branch from 6a611e3 to b59fd08CompareMay 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
Copy Markdown
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
Copy Markdown
MemberAuthor

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
Copy Markdown
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

Comment threadapps/files/lib/Command/Scan.php
// FIXME ugly hack to get it working for local file
array_shift($pathParts);
array_shift($pathParts);
array_shift($pathParts);

Copy link
Copy Markdown
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


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

Copy link
Copy Markdown
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
Copy Markdown

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

@PVince81PVince81 added this to the Nextcloud 25 milestone Aug 15, 2022
@skjnldsvskjnldsv mentioned this pull request Aug 18, 2022
This was referenced Aug 24, 2022
This was referenced Sep 6, 2022
@skjnldsvskjnldsv mentioned this pull request Sep 15, 2022
This was referenced Sep 20, 2022
@blizzzblizzz modified the milestones: Nextcloud 25, Nextcloud 26Sep 22, 2022
@artongeartonge mentioned this pull request Sep 30, 2022
@PVince81

Copy link
Copy Markdown
Member

obsoleted by #33511

@skjnldsv
skjnldsv deleted the feat/allow-scanning-metadata branch March 14, 2024 07:45
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developingWork in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@CarlSchwan@matiasdelellis@PVince81@icewind1991@blizzz