Save track queue when closing and restore at start

This commit is contained in:
Henrik Friedrichsen
2021-02-22 22:08:00 +01:00
parent a880ffd1f6
commit 92d1978340
4 changed files with 16 additions and 4 deletions

View File

@@ -106,6 +106,11 @@ impl CommandManager {
match cmd {
Command::Noop => Ok(None),
Command::Quit => {
let queue = self.queue.queue.read().expect("can't readlock queue");
self.config.with_state_mut(move |mut s| {
s.queue = queue.clone();
});
self.config.save_state();
s.quit();
Ok(None)
}