diff --git a/core/playlists/system.c b/core/playlists/system.c index 81692442..1fa20355 100644 --- a/core/playlists/system.c +++ b/core/playlists/system.c @@ -299,20 +299,15 @@ static struct sys_playlist *sys_playlists[SYS_PL_NUM_PLAYLISTS] = { static struct sys_playlist * __sys_pl_lookup(const gchar *name) { - if (string_match(name, "Favorites")) - return &sys_favorites; - else if (string_match(name, "Hidden") || string_match(name, "Banned")) + unsigned int i; + + for (i = 0; i < SYS_PL_NUM_PLAYLISTS; i++) { + if (string_match(name, sys_playlists[i]->spl_playlist.pl_name)) + return sys_playlists[i]; + } + + if (string_match(name, "Banned")) return &sys_hidden; - else if (string_match(name, "Collection")) - return &sys_collection; - else if (string_match(name, "History")) - return &sys_history; - else if (string_match(name, "Unplayed")) - return &sys_unplayed; - else if (string_match(name, "Most Played")) - return &sys_most_played; - else if (string_match(name, "Least Played")) - return &sys_least_played; return NULL; }