From 3eab7260e69270aaa5b912e38309a4021a94ecd9 Mon Sep 17 00:00:00 2001 From: JISAUAY Date: Fri, 24 Jan 2025 12:02:21 -0600 Subject: [PATCH] fixed bug with playing without selecting a song --- screens-test.py | 3 +++ textual.log | 11 ++--------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/screens-test.py b/screens-test.py index 8aab8db..f344e73 100644 --- a/screens-test.py +++ b/screens-test.py @@ -326,6 +326,9 @@ class TextualSubpyPlayer(App): self.play_pause_song() def play_pause_song(self) -> None: + if not self.currently_playing: + return None + if self.playing: self.place = pygame.mixer.music.get_pos() pygame.mixer.music.pause() diff --git a/textual.log b/textual.log index 33c97d3..41a1db9 100644 --- a/textual.log +++ b/textual.log @@ -1,9 +1,2 @@ -[2025-01-24 09:18:52,525] DEBUG in selector_events: Using selector: EpollSelector -[2025-01-24 09:18:52,547] DEBUG in screens-test: mount called -[2025-01-24 09:18:54,151] DEBUG in connectionpool: Starting new HTTPS connection (1): music.0x01fe.net:443 -[2025-01-24 09:18:54,419] DEBUG in connectionpool: https://music.0x01fe.net:443 "GET /rest/getPlaylists?u=pseudo&t=c6b26171189c620b2009abc58bc771ea&s=063M4T63&v=1.16.1&c=testing&f=json HTTP/1.1" 200 705 -[2025-01-24 09:18:55,614] DEBUG in connectionpool: Starting new HTTPS connection (1): music.0x01fe.net:443 -[2025-01-24 09:18:55,905] DEBUG in connectionpool: https://music.0x01fe.net:443 "GET /rest/getPlaylist?u=pseudo&t=1f300cff0009c58d53cd9787b0a62863&s=QOUYC15M&v=1.16.1&c=testing&f=json&id=e6e8ff27-2a60-4e33-8aa1-09586191166a HTTP/1.1" 200 None -[2025-01-24 09:18:58,356] DEBUG in screens-test: Playing song Extinction by King Gizzard & The Lizard Wizard. -[2025-01-24 09:18:58,358] DEBUG in connectionpool: Starting new HTTPS connection (1): music.0x01fe.net:443 -[2025-01-24 09:18:58,667] DEBUG in connectionpool: https://music.0x01fe.net:443 "GET /rest/stream?u=pseudo&t=4e02447422167ec59342fd7c4c42c866&s=Q7CW4DUF&v=1.16.1&c=testing&id=9d7ff682cdf372d99f1d6d8db29f4d41 HTTP/1.1" 200 11569918 +[2025-01-24 12:00:51,019] DEBUG in proactor_events: Using proactor: IocpProactor +[2025-01-24 12:00:51,225] DEBUG in screens-test: mount called