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 narrowing key result space #14

Open
harrisi opened this issue Oct 21, 2023 · 2 comments
Open

Allow narrowing key result space #14

harrisi opened this issue Oct 21, 2023 · 2 comments

Comments

@harrisi
Copy link
Contributor

harrisi commented Oct 21, 2023

It could be nice to change GET /library/keys to accept a prefix to include in the results, as in:

GET /library/keys
(returns all keys)
GET /library/keys?foo
(returns all keys starting with 'foo')

This would be handy in the case where someone has a significant amount of files in a folder, potentially deeply nested, and a client needs to make a decision about how to download the folder. See #11.

@GianniCarlo
Copy link
Contributor

adding to this, just thought to mention that a prefix (> 'all keys starting with') may catch other items not contained in a folder, e.g.

foo.mp3
foo/pilot.mp3
foo/sequel.mp3
foo bar/other.mp3

so just for clarification, the intent is just for a given folder's contents right?

@harrisi
Copy link
Contributor Author

harrisi commented Oct 26, 2023

The way I wrote the issue, yes it would just be to get a folder's contents, but after thinking about it more, this can be generalized to accommodate search features, which is probably a more useful thing to do.

Currently the search strategy for GET /library?relativePath=foo does match similarly to your example, but it doesn't give the nested items. The results of GET /library?relativePath=foo with your structure would be:

{
  "content": [
    {
      "relativePath": "foo.mp3",
      "...": "..."
    },
    {
      "relativePath": "foo",
      "...": "..."
    },
    {
      "relativePath": "foo bar",
      "...": "..."
    }
  ]
}

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