From dcbab8e37a22939f30dc17e2eba8b7ff06064d42 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 16 Jan 2017 20:55:19 +0100 Subject: [PATCH] PlaylistFile: "playlistadd" creates new playlist if it does not exist, as documented --- NEWS | 2 ++ src/PlaylistFile.cxx | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index c985e5021..c17b563f2 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.20.3 (not yet released) +* protocol + - "playlistadd" creates new playlist if it does not exist, as documented ver 0.20.2 (2017/01/15) * input diff --git a/src/PlaylistFile.cxx b/src/PlaylistFile.cxx index 806bbeea0..2deae4321 100644 --- a/src/PlaylistFile.cxx +++ b/src/PlaylistFile.cxx @@ -335,7 +335,7 @@ try { const auto path_fs = spl_map_to_fs(utf8path); assert(!path_fs.IsNull()); - FileOutputStream fos(path_fs, FileOutputStream::Mode::APPEND_EXISTING); + FileOutputStream fos(path_fs, FileOutputStream::Mode::APPEND_OR_CREATE); if (fos.Tell() / (MPD_PATH_MAX + 1) >= playlist_max_length) throw PlaylistError(PlaylistResult::TOO_LARGE,