Created
January 12, 2020 17:09
-
-
Save fkaa/c1c1cd55838e7b34ebe336a87aef29b6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/main.rs b/src/main.rs | |
index c4fdd2f..acaaa9d 100644 | |
--- a/src/main.rs | |
+++ b/src/main.rs | |
@@ -185,8 +185,12 @@ impl Application { | |
} | |
} | |
Some("play") => { | |
+ let playlist = self.playlist.lock().expect("Mutex was not poisoned"); | |
+ | |
if !self.player.is_started() { | |
- self.player.stop_current(); | |
+ if !playlist.is_empty() { | |
+ self.player.stop_current(); | |
+ } | |
} else { | |
self.player.play()?; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment