Iāve been tinkering with both postCreate and postWrite. Each of these seems to trigger multiple times per upload, and though Iāve yet to confirm it they even seem to trigger when the app is enabled from the admin panel.
How do I run code just once, after a file appears? Can anyone point me towards documentation or code examples?
I need to have access to its oc_filecache id, filename, mimetype, and parent folder.
I did look through every post that had the keyword āhookā. Unfortunately, for some reason itās firing 3-5 times every time on postCreate. I suspect that I have some misconception about what itās supposed to do, but since there is little documentation and even less activity here, I may never know the real reason.
Iāve decided to move on and attempt to not use hooks. I can pull from oc_filecache directly, assuming I can figure out how to filter those files I do not want (entries show up nearly instantly in there anyway).
I canāt figure out which files are available to which user though, and it doesnāt seem trivial in sql.
since there is little documentation and even less activity here, I may never know the real reason.
And this is the biggest problem Nextcloud has. Without proper documentation the amount of apps will stay the same, because devs canāt find information and will quit working on the app.
Iāve had several moments when i was thinking to stop developing for Nextcloud because of this.
They should place a bounty on the docs orso, so itās much more attractive to write docs.
Letās be honest: Iāve had several āthingsā which were missing on the docs, so i took a dive into the code and found the solution, but i didnāt update the docs. Why? Because itās not my job to write proper docs, and i would spend more time on writing docs than writing code, which is something i donāt prefer.