Playdar Library API

2 views
Skip to first unread message

Daniel Kantor

unread,
Nov 25, 2009, 10:50:22 AM11/25/09
to pla...@googlegroups.com
As we talked about at the Summit, I wanted to start a dialogue here on an API to return a user's full library. This could be very useful for sites that instantly want to know what a user owns so that it could make recommendations, play the music, etc. Here is a proposal:

/api/library?type=all

{"genres" : ["Rap", "Rock"], "artists" : ["Madonna", "Michael Jackson"], "albums" : ["Thriller", "Bad"], "tracks" : [{"genre" : "Rock", "artist" : "Michael Jackson", "album" : "Thriller", "track" : "Beat It", "mimetype" : "audio/mpeg", "duration" : 179, "bitrate" : 320", "size" : 7186388, "source" : "local"}, {"genre" : "Rock", "artist" : "Michael Jackson", "album" : "Thriller", "track" : "Billy Jean", "mimetype" : "audio/mpeg", "duration" : 210, "bitrate" : 320", "size" : 8186388, "source" : "local"}]}

/api/library?type=genres

{"genres" : ["Rap", "Rock"]}

/api/library?type=artists

{"artists" : ["Madonna", "Michael Jackson"]}

/api/library?type=albums

{"albums" : ["Thriller", "Bad"]}

/api/library?type=tracks

{"tracks" : [{"genre" : "Rock", "artist" : "Michael Jackson", "album" : "Thriller", "track" : "Beat It", "mimetype" : "audio/mpeg", "duration" : 179, "bitrate" : 320", "size" : 7186388, "source" : "local"}, {"genre" : "Rock", "artist" : "Michael Jackson", "album" : "Thriller", "track" : "Billy Jean", "mimetype" : "audio/mpeg", "duration" : 210, "bitrate" : 320", "size" : 8186388, "source" : "local"}]}

/api/library?type=artists&genre=Rock

{"artists" : ["Michael Jackson"]}

/api/library?type=albums&genre=Rock&artist=Michael%20Jackson

{"albums" : ["Thriller", "Bad"]}

/api/library?type=tracks&genre=Rock&artist=Michael%20Jackson&album=Thriller

{"tracks" : [{"genre" : "Rock", "artist" : "Michael Jackson", "album" : "Thriller", "track" : "Beat It", "mimetype" : "audio/mpeg", "duration" : 179, "bitrate" : 320", "size" : 7186388, "source" : "local"}, {"genre" : "Rock", "artist" : "Michael Jackson", "album" : "Thriller", "track" : "Billy Jean", "mimetype" : "audio/mpeg", "duration" : 210, "bitrate" : 320", "size" : 8186388, "source" : "local"}]}


I think this should return local files, but it doesn't have to be restricted to that. If Playdar 'knows' a user's Napster library, it should return that as well. What do you guys think?


Jason Herskowitz

unread,
Nov 25, 2009, 11:05:29 AM11/25/09
to pla...@googlegroups.com
Dan -

I would love to also see some query parameters for:

* offset and limit (chunking) - just give me the next 10 tracks starting at track #21 (given an alpha sort)
* sorts (alpha/reverse alpha, chronological/reverse chron) - give me back all albums I have by U2 sorted by reverse chronological order of release date

Also, if we can get popularity via local playcounts and/or Last.fm calls then sorts by popularity (playcounts) too.

Thoughts?

- J


--

You received this message because you are subscribed to the Google Groups "playdar" group.
To post to this group, send email to pla...@googlegroups.com.
To unsubscribe from this group, send email to playdar+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/playdar?hl=en.

Lucas Gonze

unread,
Nov 25, 2009, 2:49:47 PM11/25/09
to pla...@googlegroups.com
Issues to sort out:

- what fields? exactly how are they defined?
- mp3 only, any mp3-compatible file type, or some more abstract
target? this affects which fields are included, like 'bitrate.'
- security and privacy risks? how to address?
- implementation architecture. can this be implemented outside the
core, or in a module that somebody aside from RJ owns?

==

The genre tag is asking for trouble. It's very often wrong, missing,
or incomplete, so features built on this tag will be buggy. Is it
possible to move genre into the cloud and out of the client? For
example, the web app would get track identifiers, then run genre
lookups via a web service. In that case we should talk about diffs,
so a web app only needs to upload the parts of a user's catalog that
have changed.

An "identifier" or "fingerprint" field would go a long way. MBID?

===

Let's talk out privacy and security issues. Obviously the user needs
to be notified and asked. The situation is probably just the same as
the standard browser "upload" dialog, which the user has experience
with.

Daniel Kantor

unread,
Nov 25, 2009, 2:56:08 PM11/25/09
to pla...@googlegroups.com
Outside of the fields I listed below, what else would you like to see?

As far as security goes, it could either be one 'Allow' gives all access (needs to be clearer in the auth page) or separate auths for different things (like FB Connect).

For genre, it would be nice to get 'official' last.fam tags, but there is certainly value in seeing what the user has tagged themselves. Especially for something like playdarTunes where the genre representation would be the same as what iTunes has.

Lucas Gonze

unread,
Nov 25, 2009, 3:55:41 PM11/25/09
to pla...@googlegroups.com
I guess I'd like to see less. Every one of these fields needs to be
documented, implemented across every media type, and maintained, so
there will be ongoing cost. Ideally I'd just do a content identifier
and hang all the metadata off that. (I know that's not practical,
it's just an ideal.)

If the metadata was just the stuff in an xspf file (title, creator,
duration, album, track number) what would the loss be? That way
there's no need to debate and document issues like cardinality or
which type of integer.

A security issue is that the confirmation UI can't be in the web app,
because it's the security risk that has to be authorized. A
comparable thing is the file upload dialog. But the Playdar core
doesn't have a GUI. Could the prefpane supply the GUI?

For genre I'm pretty sure that what you ahve in mind is playdarTunes,
and duplicating all that functionality. If the genre data in this
context is no worse than the genre in iTunes it doesn't bug you,
right?

Max Howell

unread,
Nov 25, 2009, 11:53:46 PM11/25/09
to pla...@googlegroups.com
Regarding the genre tag, if we get the Last.fm boffin plugin up again
we could group based on last.fm tag data.
Reply all
Reply to author
Forward
0 new messages