Add better data removal, fix small benign bug

This commit is contained in:
DaXcess
2024-08-13 11:31:54 +02:00
parent 576e2ef563
commit ef86e1e2d3
5 changed files with 32 additions and 8 deletions
+5
View File
@@ -516,6 +516,11 @@ impl songbird::EventHandler for SessionHandle {
}
EventContext::ClientDisconnect(ClientDisconnect { user_id }) => {
// Ignore disconnects if we're inactive
if !self.active().await.unwrap_or(false) {
return None;
}
match self.owner().await {
Ok(id) if id.get() == user_id.0 => {
debug!("Owner of session disconnected, stopping playback");