We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ec10401 commit e733eaaCopy full SHA for e733eaa
doc/index.rst
@@ -252,6 +252,8 @@ Playlist Commands
252
253
:command:`save <file>` - Saves playlist as <file>.
254
255
+:command:`replace <file>` - Replaces playlist in <file>.
256
+
257
:command:`addplaylist <playlist> <file>` - Adds a song from the music database to the
258
playlist. The playlist will be created if it does not exist.
259
Can also read input from pipes.
src/command.c
@@ -1376,3 +1376,12 @@ cmd_partitiondelete(int argc, char **argv, struct mpd_connection *conn) {
1376
}
1377
return 0;
1378
1379
1380
+int
1381
+cmd_replace(gcc_unused int argc, char **argv, struct mpd_connection *conn)
1382
+{
1383
+ if (!mpd_send_save_queue(conn, charset_to_utf8(argv[0]), MPD_QUEUE_SAVE_MODE_REPLACE)) {
1384
+ printErrorAndExit(conn);
1385
+ }
1386
+ return 0;
1387
+}
src/command.h
@@ -69,4 +69,7 @@ cmd_subscribe(int argc, char **argv, struct mpd_connection *conn);
69
int
70
cmd_tags(int argc, char **argv, struct mpd_connection *conn);
71
72
73
+cmd_replace(int argc, char **argv, struct mpd_connection *conn);
74
75
#endif /* COMMAND_H */
src/main.c
@@ -102,6 +102,7 @@ static const struct command {
102
{"readpicture", 1, 1, 0, cmd_readpicture, "<uri>", "Download a picture from the given song and write to stdout." },
103
{"renplaylist", 2, 2, 0, cmd_renplaylist, "<file> <newfile>", "Rename a playlist"},
104
{"repeat", 0, 1, 0, cmd_repeat, "<on|off>", "Toggle repeat mode, or specify state"},
105
+ {"replace", 1, 1, 0, cmd_replace, "<file>", "Save a queue as <file>, replacing the existing one"},
106
{"replaygain", 0, -1, 0, cmd_replaygain, "[off|track|album]", "Set or display the replay gain mode" },
107
{"rescan", 0, -1, 2, cmd_rescan, "[<path>]", "Rescan music directory (including unchanged files)"},
108
{"rm", 1, 1, 0, cmd_rm, "<file>", "Remove a playlist"},
0 commit comments