-
Notifications
You must be signed in to change notification settings - Fork 9
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
Image category / properties #3
Comments
Yes, good point—I was thinking about this too. At the very least there should be a way to distinguish categories of images, and image data like the MIME type and dimensions would be useful too. That would be hard to retrofit onto the current design, so let's change it now. I can see this going one of three ways:
Option 3 is closer to the JSON API spec, but I think I lean toward option 2 for simplicity—since it seems like a pain for servers to supply globally unique ids for all images. Any thoughts? |
I was thinking about 2. too :). 1. should be avoided and beside 3. complexity, I cannot remember myself real use case on shared image files (each library item generally have his own set of images). |
I just pushed a draft of a more complete spec for images: http://auraspec.readthedocs.org/en/latest/api.html#images It might be a good idea to add a more complete list of possible "role" values (I just stuck "cover" in there as an example). Do you have a notion of what a somewhat-complete list would consist of, @Afterster? I'm also not 100% sold on the sub-resource id space for images; an argument could be made that a global image set would actually be easier to implement for both client and server. A server that effectively has image sets per resource could still, for example, use ids like "track-42-1" to internally map to the image 1 for track 42. So I might still come back and change this around. 😇 |
One drawback to what I just proposed: it might be a pain for servers to enumerate all the images in the system at |
To continue this discussion after nearly 6 years, I think globally unique image ids are required for inclusion. Say the client gets a collection of albums All is well and good if the client looks up metadata about each image individually - it just makes a load of requests in the form Now say that the client requests inclusion of images for the same collection: This problem is probably the reason behind the JSON API requirement:
I only noticed this while implementing the current spec for album images; it's not very obvious otherwise. I ended up having to give images globally unique ids anyway for it to work. To do that I just included the 'parent' type and id in the image id, so an image would have an id like 'album-42-cover.jpg' (probably not the nicest way but seems to work). I do agree with @sampsyo that
|
That's a great analysis, @out-of-range. This is quite convincing, and those "compound IDs" you're generating like |
Cool, I'll see what changes I can come up with for the spec. |
- Changed endpoints for images - Removed example (other resources don't have examples) - Added relationship requirements - Added reason for /aura/images to be a 404 - Made suggestion to use compound ids - Moved Images section to after Artists (so collections are together) See #3 for relevant discussion.
In current Images api, images are only identified by an index and associated library item. I believe this will be too restricting on a real use case:
The text was updated successfully, but these errors were encountered: