mirror of
https://github.com/owntone/owntone-server.git
synced 2025-03-20 04:24:20 -04:00
Merge pull request #365 from chme/spotifybaseplaylist
Avoid adding spotify playlist folder
This commit is contained in:
commit
efd6805f9e
@ -403,6 +403,8 @@ static enum command_state
|
|||||||
webapi_pl_save(void *arg, int *ret);
|
webapi_pl_save(void *arg, int *ret);
|
||||||
static enum command_state
|
static enum command_state
|
||||||
webapi_pl_remove(void *arg, int *ret);
|
webapi_pl_remove(void *arg, int *ret);
|
||||||
|
static void
|
||||||
|
create_base_playlist();
|
||||||
|
|
||||||
/* ------------------------------- MISC HELPERS ---------------------------- */
|
/* ------------------------------- MISC HELPERS ---------------------------- */
|
||||||
|
|
||||||
@ -1505,6 +1507,9 @@ logged_in(sp_session *sess, sp_error error)
|
|||||||
|
|
||||||
DPRINTF(E_LOG, L_SPOTIFY, "Login to Spotify succeeded, reloading playlists\n");
|
DPRINTF(E_LOG, L_SPOTIFY, "Login to Spotify succeeded, reloading playlists\n");
|
||||||
|
|
||||||
|
if (!spotify_access_token_valid)
|
||||||
|
create_base_playlist();
|
||||||
|
|
||||||
db_directory_enable_bypath("/spotify:");
|
db_directory_enable_bypath("/spotify:");
|
||||||
|
|
||||||
pl = fptr_sp_session_starred_create(sess);
|
pl = fptr_sp_session_starred_create(sess);
|
||||||
@ -2261,6 +2266,9 @@ create_saved_tracks_playlist()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Add or update playlist folder for all spotify playlists (if enabled in config)
|
||||||
|
*/
|
||||||
static void
|
static void
|
||||||
create_base_playlist()
|
create_base_playlist()
|
||||||
{
|
{
|
||||||
@ -2296,11 +2304,6 @@ initscan()
|
|||||||
db_spotify_purge();
|
db_spotify_purge();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Add playlist folder for all spotify playlists
|
|
||||||
*/
|
|
||||||
create_base_playlist();
|
|
||||||
|
|
||||||
spotify_saved_plid = 0;
|
spotify_saved_plid = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2314,6 +2317,7 @@ initscan()
|
|||||||
*/
|
*/
|
||||||
if (spotify_access_token_valid)
|
if (spotify_access_token_valid)
|
||||||
{
|
{
|
||||||
|
create_base_playlist();
|
||||||
create_saved_tracks_playlist();
|
create_saved_tracks_playlist();
|
||||||
scan_saved_albums();
|
scan_saved_albums();
|
||||||
scan_playlists();
|
scan_playlists();
|
||||||
|
@ -730,10 +730,6 @@ tokens_get(struct keyval *kv, const char **err)
|
|||||||
|
|
||||||
token_requested = time(NULL);
|
token_requested = time(NULL);
|
||||||
|
|
||||||
DPRINTF(E_LOG, L_SPOTIFY, "token: '%s'\n", spotify_access_token);
|
|
||||||
DPRINTF(E_LOG, L_SPOTIFY, "refresh-token: '%s'\n", spotify_refresh_token);
|
|
||||||
DPRINTF(E_LOG, L_SPOTIFY, "expires in: %d\n", expires_in);
|
|
||||||
|
|
||||||
if (spotify_refresh_token)
|
if (spotify_refresh_token)
|
||||||
db_admin_set("spotify_refresh_token", spotify_refresh_token);
|
db_admin_set("spotify_refresh_token", spotify_refresh_token);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user