-
Notifications
You must be signed in to change notification settings - Fork 1
How Songs are Represented
MakotoTheKnight edited this page Jan 10, 2013
·
1 revision
Primarily, K'atun deals with large collections of songs. However, it would be woefully inefficient to store all of our binary blobs into a database. We'd effectively be storing the same data twice!
Right now, we leverage Mutagen to parse our music's metadata. The primary things we're interested in with relation to a song is:
- Where it's stored on your local device
- What the title is
- What the author is
- What the genre(s) are
- What playlists, if any, it is tied to
- How long it is
The actual binary blob should never make it into the database model.
##How the Database Sees Songs
We're leveraging MongoDB for our database. Our structure for a song is as follows:
song = {
"location": "/path/to/this/song",
"title": "The Song",
"author": "The Author",
"genre": ["Hip-Hop", "Culture", "Awesome"]
"playlists": ["Down the Road Music", "Chill Out Music", "Party Music"]
}
What this implies is that a song is very closely tied to a playlist of some sort.