-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
There are a lot of genres and it's difficult to organize 'new wave' and 'glimmer pop' into playlists. Could you have a function which sorts tracks into larger genre categories to automate this process for the user?
I had a go at prototyping it quickly by adding this function:
function simplifyGenre(genre) {
if (genre.indexOf('classical') !== -1 ||
genre.indexOf('jazz') !== -1 ||
genre.indexOf('swing') !== -1 ||
genre.indexOf('world') !== -1) { return 'classical, jazz & world'; }
else if (genre.indexOf('alternative') !== -1 ||
genre.indexOf('indie') !== -1 ||
genre.indexOf('folk') !== -1) { return 'alternative, folk & indie'; }
else if (genre.indexOf('dance') !== -1 ||
genre.indexOf('drum and bass') !== -1 ||
genre.indexOf('electro') !== -1 ||
genre.indexOf('garage') !== -1 ||
genre.indexOf('house') !== -1 ||
genre.indexOf('beat') !== -1 ||
genre.indexOf('break') !== -1 ||
genre.indexOf('rave') !== -1) { return 'electronic, dance & house'; }
else if (genre.indexOf('downtempo') !== -1 ||
genre.indexOf('lounge') !== -1 ||
genre.indexOf('easy') !== -1 ||
genre.indexOf('chill') !== -1) { return 'lounge, downtempo & chillout'; }
else if (genre.indexOf('funk') !== -1 ||
genre.indexOf('disco') !== -1 ||
genre.indexOf('r&b') !== -1 ||
genre.indexOf('reggae') !== -1 ||
genre.indexOf('soul') !== -1 ||
genre.indexOf('motown') !== -1,
genre.indexOf('quiet storm') !== -1) { return 'funk, soul & reggae'; }
else if (genre.indexOf('hip') !== -1 ||
genre.indexOf('hop') !== -1 ||
genre.indexOf('rap') !== -1 ||
genre.indexOf('urban') !== -1) { return 'hip-hop, rap & urban'; }
else if (genre.indexOf('rock') !== -1 ||
genre.indexOf('blues') !== -1 ||
genre.indexOf('metal') !== -1 ||
genre.indexOf('mellow gold') !== -1 ||
genre.indexOf('wave') !== -1) { return 'rock, metal & blues'; }
else { return genre; }
}
Then within your addTracks method:
_.each(genres, function(genre) {
genre = simplifyGenre(genre);
This is how it comes out:
Although my version is not perfect (I'm guessing because the genres are based on an album, not a song?) could you implement something like this to your tool?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
