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 to get received shares #30

Closed
JocelynDelalande opened this issue Feb 18, 2025 · 8 comments
Closed

Allow to get received shares #30

JocelynDelalande opened this issue Feb 18, 2025 · 8 comments

Comments

@JocelynDelalande
Copy link
Contributor

JocelynDelalande commented Feb 18, 2025

Currently, there is no way to get the shares that I received.

I hacked arround that way to get those shares : 

class PatchedNextCloudAsync(NextCloudAsync):
    async def get_all_shares(self):

        return await self.ocs_query(
            method='GET',
            sub='/ocs/v2.php/apps/files_sharing/api/v1/shares',
            data=dict(shared_with_me='true')
        )

But I think the code base may implement it somehow nicer than my ugly hack.

(sadly, this param is undocumented in ocs API doc)

@aaronsegura
Copy link
Owner

aaronsegura added a commit that referenced this issue Feb 18, 2025
* Add parameters for shared_with_me and include_tags
* Bump version to 0.0.10
@aaronsegura
Copy link
Owner

I modified the get_file_shares function to allow for these parameters, but I'm unable to test right now. Can you checkout the shared-with-me branch and let me know if it works for you?

@aaronsegura
Copy link
Owner

Nevermind, I was able to test it. It works! Will merge and cut a new release momentarily.

@aaronsegura
Copy link
Owner

@JocelynDelalande
Copy link
Contributor Author

Youhou, thanks !

@JocelynDelalande
Copy link
Contributor Author

IMHO, all those args should be offered in get_all_shares() also

To stick more closely to the API, maybe get_shares() may accept a None value as « path » arg and get_all_shares() turned into a pass-through to get_all_shares() with path=None ?

And maybe get_all_shares() can be deprecated ?

@aaronsegura
Copy link
Owner

Makes sense. They both use the same endpoint. I think I was just following along with the API documentation when I made them both. If I had thought about it I probably would have done what you're recommending.

Changes in master

Don't see the need for a new release to be cut, but I will if you want one.

@JocelynDelalande
Copy link
Contributor Author

JocelynDelalande commented Feb 19, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants