Skip to content

Conversation

@Bungeefan
Copy link
Contributor

@Bungeefan Bungeefan commented Sep 29, 2025

Closes #277

This PR adds the requested "Shared with me" directory setting, along with the following improvements:

  • Replaced manual ownedByMe check with a Drive API query parameter
  • Move user-owned folders that exist in "shared" folders into the "Shared with me" folder
  • Implemented the import of shared files (files without any parent folders)
    • Unfortunately, for this feature, I had to fallback to a local check (empty parents) as I was unable to reach the same result with the Google Drive Query API.

Feel free to request changes, I am myself not super happy with the implementation, but further improvements would require more refactoring, which I didn't feel comfortable starting without any feedback/guidance (therefore, I tried to change as little as possible while still preventing duplicated code).

@Bungeefan Bungeefan force-pushed the shared_with_me_dir branch 2 times, most recently from 6b01d22 to 6731996 Compare October 1, 2025 16:31
Copy link
Member

@lukasdotcom lukasdotcom left a comment

Choose a reason for hiding this comment

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

Hi @Bungeefan 👋,

Thanks so much for the comprehensive pr. I tested it and it worked on my simple test accounts 🎉. I've added some feedback.

Copy link
Member

@lukasdotcom lukasdotcom left a comment

Choose a reason for hiding this comment

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

You have a failing check that can be fixed with composer cs:fix, but other then that it looks good. If there are any specific refactoring you want to do I can tell you if they make sense.

Signed-off-by: Severin Hamader <[email protected]>
@Bungeefan
Copy link
Contributor Author

Thanks for the review, fixed the obsolete import.

As I could already remove a lot of the parameters from the retrieveFiles function, I am now fine with that.
However, I am still debating about the optional $allowParents parameter, but besides aesthetics I don't think there is really much to improve in its current state and, at first, I was unsure about the addition of $sharedDirectoriesById and therefore separation from $directoriesById (instead of just a flag in the original array), but I guess it's fine either way.

If you have no further objections, feel free to merge it.

Copy link
Member

@lukasdotcom lukasdotcom left a comment

Choose a reason for hiding this comment

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

Thanks. I'll merge it then 🚀

@lukasdotcom lukasdotcom merged commit 26fb9ed into nextcloud:main Oct 8, 2025
20 checks passed
@Bungeefan Bungeefan deleted the shared_with_me_dir branch October 8, 2025 13:22
@lukasdotcom lukasdotcom mentioned this pull request Oct 10, 2025
@github-actions
Copy link

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Different folder for shared files

2 participants