AllCommands: "commands" returns playlist commands only if playlist_directory configured
This commit is contained in:
parent
fa0aa91bf9
commit
575fbad254
2
NEWS
2
NEWS
|
@ -1,4 +1,6 @@
|
||||||
ver 0.20 (not yet released)
|
ver 0.20 (not yet released)
|
||||||
|
* protocol
|
||||||
|
- "commands" returns playlist commands only if playlist_directory configured
|
||||||
* output
|
* output
|
||||||
- pulse: set channel map to WAVE-EX
|
- pulse: set channel map to WAVE-EX
|
||||||
|
|
||||||
|
|
|
@ -210,6 +210,16 @@ command_available(gcc_unused const Partition &partition,
|
||||||
return neighbor_commands_available(partition.instance);
|
return neighbor_commands_available(partition.instance);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (strcmp(cmd->cmd, "save") == 0 ||
|
||||||
|
strcmp(cmd->cmd, "rm") == 0 ||
|
||||||
|
strcmp(cmd->cmd, "rename") == 0 ||
|
||||||
|
strcmp(cmd->cmd, "playlistdelete") == 0 ||
|
||||||
|
strcmp(cmd->cmd, "playlistmove") == 0 ||
|
||||||
|
strcmp(cmd->cmd, "playlistclear") == 0 ||
|
||||||
|
strcmp(cmd->cmd, "playlistadd") == 0 ||
|
||||||
|
strcmp(cmd->cmd, "listplaylists") == 0)
|
||||||
|
return playlist_commands_available();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,9 +35,17 @@
|
||||||
#include "protocol/ArgParser.hxx"
|
#include "protocol/ArgParser.hxx"
|
||||||
#include "protocol/Result.hxx"
|
#include "protocol/Result.hxx"
|
||||||
#include "ls.hxx"
|
#include "ls.hxx"
|
||||||
|
#include "Mapper.hxx"
|
||||||
|
#include "fs/AllocatedPath.hxx"
|
||||||
#include "util/UriUtil.hxx"
|
#include "util/UriUtil.hxx"
|
||||||
#include "util/Error.hxx"
|
#include "util/Error.hxx"
|
||||||
|
|
||||||
|
bool
|
||||||
|
playlist_commands_available()
|
||||||
|
{
|
||||||
|
return !map_spl_path().IsNull();
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_spl_list(Client &client, const PlaylistVector &list)
|
print_spl_list(Client &client, const PlaylistVector &list)
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,9 +21,14 @@
|
||||||
#define MPD_PLAYLIST_COMMANDS_HXX
|
#define MPD_PLAYLIST_COMMANDS_HXX
|
||||||
|
|
||||||
#include "CommandResult.hxx"
|
#include "CommandResult.hxx"
|
||||||
|
#include "Compiler.h"
|
||||||
|
|
||||||
class Client;
|
class Client;
|
||||||
|
|
||||||
|
gcc_const
|
||||||
|
bool
|
||||||
|
playlist_commands_available();
|
||||||
|
|
||||||
CommandResult
|
CommandResult
|
||||||
handle_save(Client &client, unsigned argc, char *argv[]);
|
handle_save(Client &client, unsigned argc, char *argv[]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue