diff --git a/forked-daapd.conf b/forked-daapd.conf index b9891872..7b41e6e9 100644 --- a/forked-daapd.conf +++ b/forked-daapd.conf @@ -164,6 +164,11 @@ spotify { # 0: No preference (default), 1: 96kbps, 2: 160kbps, 3: 320kbps # bitrate = 0 + # Your Spotify playlists will by default be put in a "Spotify" playlist + # folder. If you would rather have them together with your other + # playlists you can set this option to true. +# base_playlist_disable = false + # Spotify playlists usually have many artist, and if you don't want every # artist to be listed when artist browsing in Remote, you can set the # artist_override flag to true. This will use the compilation_artist as diff --git a/src/conffile.c b/src/conffile.c index af94ee0a..c6801d20 100644 --- a/src/conffile.c +++ b/src/conffile.c @@ -113,6 +113,7 @@ static cfg_opt_t sec_spotify[] = CFG_STR("settings_dir", STATEDIR "/cache/" PACKAGE "/libspotify", CFGF_NONE), CFG_STR("cache_dir", "/tmp", CFGF_NONE), CFG_INT("bitrate", 0, CFGF_NONE), + CFG_BOOL("base_playlist_disable", cfg_false, CFGF_NONE), CFG_BOOL("artist_override", cfg_false, CFGF_NONE), CFG_BOOL("starred_artist_override", cfg_false, CFGF_NONE), CFG_BOOL("album_override", cfg_false, CFGF_NONE), diff --git a/src/spotify.c b/src/spotify.c index 680d3b6d..9d658077 100644 --- a/src/spotify.c +++ b/src/spotify.c @@ -1245,6 +1245,7 @@ artwork_get(struct spotify_command *cmd) static void logged_in(sp_session *sess, sp_error error) { + cfg_t *spotify_cfg; sp_playlist *pl; sp_playlistcontainer *pc; struct playlist_info pli; @@ -1264,17 +1265,23 @@ logged_in(sp_session *sess, sp_error error) pl = fptr_sp_session_starred_create(sess); fptr_sp_playlist_add_callbacks(pl, &pl_callbacks, NULL); - memset(&pli, 0, sizeof(struct playlist_info)); - pli.title = "Spotify"; - pli.type = PL_PLAIN; - pli.path = "spotify:playlistfolder"; - - ret = db_pl_add(&pli, &g_base_plid); - if (ret < 0) + spotify_cfg = cfg_getsec(cfg, "spotify"); + if (! cfg_getbool(spotify_cfg, "base_playlist_disable")) { - DPRINTF(E_LOG, L_SPOTIFY, "Error adding base playlist\n"); - return; + memset(&pli, 0, sizeof(struct playlist_info)); + pli.title = "Spotify"; + pli.type = PL_FOLDER; + pli.path = "spotify:playlistfolder"; + + ret = db_pl_add(&pli, &g_base_plid); + if (ret < 0) + { + DPRINTF(E_LOG, L_SPOTIFY, "Error adding base playlist\n"); + return; + } } + else + g_base_plid = 0; pc = fptr_sp_session_playlistcontainer(sess);