mpd not saving playist on exit

Need help with MPD?
Post Reply
mzagrabe
Posts: 2
Joined: April 22nd, 2019, 4:18 pm

mpd not saving playist on exit

Post by mzagrabe » April 22nd, 2019, 6:32 pm

Greetings,

I spawn mpd automatically via the session manager when I log in to my graphical desktop. Things work good, but I am expecting the current playlist mpd has to be reloaded when I restart the computer and mpd respawns. When mpd loads, the playlist is empty.

Is there a way to get mpd to save and then reload the playlist the next time it starts?

Thanks!

-m

max
Forum team
Posts: 923
Joined: January 15th, 2013, 3:43 pm

Re: mpd not saving playist on exit

Post by max » April 23rd, 2019, 10:17 am

Yes.

(Before you complain: this is an exact and complete answer to your question. If that doesn't satisfy you, ask a different question. Before you do that, read https://www.musicpd.org/help/)

mzagrabe
Posts: 2
Joined: April 22nd, 2019, 4:18 pm

Re: mpd not saving playist on exit

Post by mzagrabe » April 23rd, 2019, 3:16 pm

Thanks for the hint, Max!

For posterity, there is a state_file setting:

state_file <file>
This specifies if a state file is used and where it is located. The state of mpd will be saved to this file when mpd is terminated by a
TERM signal or by the "kill" command. When mpd is restarted, it will read the state file and restore the state of mpd (including the
playlist).

Cheers,

-m

Post Reply