I am writing my own little (web based) music player at the moment. But I am failing because of some albums. I store all the information about songs, albums, and artists in a NoSQL database, like this:
{
"artist" : "Some artist",
"albums" :
[
{
"name": "Some album",
"info" :
{
"id" : ObjectId("534a7d66f1053d665015825b"),
"released" : "2013"
},
"songs" :
[
{
"name" : "Some song",
"file" : "music.mp3",
"time" : 219,
"id" : ObjectId("534a7d66f1053d665015825c")
}
]
}
],
"_id" : ObjectId("534a7d66f1053d665015825d")
}
Now I want to show the user all the albums he owns. No problem. Loop through all artists, select all albums, show them to the user. This would work great weren't there no compilations. When I show all albums like descriped above, the user sees the compilation multiple times, once per artist.
Now I looked at my current music player - Banshee - and saw that it shows all compilations as albums from "Various". But how does it know? It's not in the ID3 tags. The only thing I could think of would be somethink like: If more than half of the songs are from different artists -> "Various". Is this the solution? Or do you guys know something else?