From eb2d14ec17066a64122c6b2a3e5496a1bb25f6d4 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Tue, 10 Dec 2013 21:13:47 +0100 Subject: core: fixed opening files into default playlist from cmdline --- main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index d5a7b83d..43019e15 100644 --- a/main.c +++ b/main.c @@ -283,12 +283,6 @@ server_exec_command_line (const char *cmdline, int len, char *sendback, int sbsi parg++; } if (parg < pend) { - playlist_t *curr_plt = plt_get_curr (); - if (plt_add_files_begin (curr_plt, 0) != 0) { - plt_unref (curr_plt); - snprintf (sendback, sbsize, "it's not allowed to add files to playlist right now, because another file adding operation is in progress. please try again later."); - return 0; - } if (conf_get_int ("cli_add_to_specific_playlist", 1)) { char str[200]; conf_get_str ("cli_add_playlist_name", "Default", str, sizeof (str)); @@ -300,6 +294,12 @@ server_exec_command_line (const char *cmdline, int len, char *sendback, int sbsi plt_set_curr_idx (idx); } } + playlist_t *curr_plt = plt_get_curr (); + if (plt_add_files_begin (curr_plt, 0) != 0) { + plt_unref (curr_plt); + snprintf (sendback, sbsize, "it's not allowed to add files to playlist right now, because another file adding operation is in progress. please try again later."); + return 0; + } // add files if (!queue) { plt_clear (curr_plt); -- cgit v1.2.3