implement logout command

fixes #470
This commit is contained in:
Henrik Friedrichsen
2021-03-22 21:56:22 +01:00
parent 5f87e3cd79
commit a0231362f1
3 changed files with 22 additions and 0 deletions

View File

@@ -233,6 +233,16 @@ impl CommandManager {
});
Ok(None)
}
Command::Logout => {
self.spotify.shutdown();
let mut credentials_path = crate::config::cache_path("librespot");
credentials_path.push("credentials.json");
std::fs::remove_file(credentials_path).unwrap();
s.quit();
Ok(None)
}
Command::Jump(_)
| Command::Move(_, _)
| Command::Shift(_, _)