xaizek / pms (License: GPLv3+) (since 2018-12-07)
Older version of Practical Music Search written in C++.
Commit 627637e1361f8a850a69286cff793695dcc310ba

Fix :create command which behaved as :save

Author: Kim Tore Jensen
Author date (UTC): 2015-08-30 09:27
Committer: Kim Tore Jensen
Commit date (UTC): 2015-08-30 09:27
Tree: 12807652ec1eebd5572751bf77f798bec0e9d9c1
Parents: 3e7e68b723debd4435c4a437c16b4b4fbfd254b0
File Lines added Lines deleted
src/command.cpp 24 1
src/command.h 1 0

File src/command.cpp changed (mode: 100644) (index 4596280..763a39c)
... ... Control::create_playlist(string name)
1599 1599 { {
1600 1600 EXIT_IDLE; EXIT_IDLE;
1601 1601
1602 pms->log(MSG_DEBUG, 0, "Creating a new playlist '%s'\n", name.c_str());
1602 pms->log(MSG_DEBUG, 0, "Creating playlist '%s'\n", name.c_str());
1603
1604 /* Apparently, it is enough to run "playlistclear" in order to create a
1605 * new playlist. However, we do not get protection against clearing an
1606 * existing playlist. This is worked around by calling mpd_run_save()
1607 * first, which will complain with a suitable error message. */
1608 if (mpd_run_save(conn->h(), name.c_str())) {
1609 mpd_run_playlist_clear(conn->h(), name.c_str());
1610 }
1611
1612 return get_error_bool();
1613 }
1614
1615 /*
1616 * Save the queue contents into a stored playlist.
1617 *
1618 * Returns true on success, false on failure.
1619 */
1620 bool
1621 Control::save_playlist(string name)
1622 {
1623 EXIT_IDLE;
1624
1625 pms->log(MSG_DEBUG, 0, "Saving the queue into playlist '%s'\n", name.c_str());
1603 1626
1604 1627 return mpd_run_save(conn->h(), name.c_str()); return mpd_run_save(conn->h(), name.c_str());
1605 1628 } }

File src/command.h changed (mode: 100644) (index 64785a5..8b1c55c)
... ... public:
306 306 /* List management */ /* List management */
307 307 Playlist * find_playlist(string filename); Playlist * find_playlist(string filename);
308 308 bool create_playlist(string name); bool create_playlist(string name);
309 bool save_playlist(string name);
309 310 bool delete_playlist(string name); bool delete_playlist(string name);
310 311 Songlist * activelist(); Songlist * activelist();
311 312 bool activatelist(Songlist *); bool activatelist(Songlist *);
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/pms

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/pms

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master