trying to fix the queue this still

This commit is contained in:
JISAUAY committed 2025-01-31 16:29:36 -06:00
1 parent b08337f870
commit aa804e66d6
2 files changed
+27 -46

No files matched your search

+21 -15
View File
@@ -16,7 +16,7 @@ import SubSonic
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide" os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide"
import pygame import pygame
from rich.table import Table from rich.table import Table, Column
from textual import on, events, work from textual import on, events, work
from textual.reactive import reactive from textual.reactive import reactive
@@ -333,13 +333,14 @@ class QueueTable(Widget):
return table return table
# Fine to be a static renderable because it's not big enough to need a scroll
class PlayingInfo(Widget): class PlayingInfo(Widget):
def render(self) -> RenderResult: def render(self) -> RenderResult:
table = Table() table = Table()
table.add_column("") table.add_column("")
table.add_column("") table.add_column("", min_width=10)
table.show_header = False table.show_header = False
if app.currently_playing: if app.currently_playing:
@@ -354,6 +355,8 @@ class PlayingInfo(Widget):
return table return table
# https://textual.textualize.io/widgets/data_table/#labeled-rows
# Add this ^ to queue sometime plz
class MainView(Screen): class MainView(Screen):
CSS_PATH = 'main.tcss' CSS_PATH = 'main.tcss'
@@ -365,16 +368,17 @@ class MainView(Screen):
yield PlayingInfo() yield PlayingInfo()
yield ProgressBar() yield ProgressBar()
yield CoverArtPixels() yield CoverArtPixels()
# with Vertical(classes="column"): with Vertical(classes="column"):
# yield Label("Queue") yield Label("Queue")
yield VerticalScroll(QueueTable()) yield DataTable(id="queue")
# yield VerticalScroll(QueueTable())
yield Footer() yield Footer()
def on_mount(self) -> None: def on_mount(self) -> None:
app.sub_title = "Overview" app.sub_title = "Overview"
# queueTable: DataTable = self.query_one("#queue") queueTable: DataTable = self.query_one("#queue")
# queueTable.cursor_type = "row" queueTable.cursor_type = "row"
# queueTable.add_columns("Title", "Album", "Artist", "Plays", "Duration", "Bitrate") queueTable.add_columns("Title", "Album", "Artist", "Plays", "Duration", "Bitrate")
# currentlyPlaying: DataTable = self.query_one('#currently_playing') # currentlyPlaying: DataTable = self.query_one('#currently_playing')
# currentlyPlaying.cursor_type = "row" # currentlyPlaying.cursor_type = "row"
@@ -385,14 +389,14 @@ class MainView(Screen):
app.sub_title = "Overview" app.sub_title = "Overview"
# Update Queue Table # Update Queue Table
# queueTable: DataTable = self.query_one('#queue') queueTable: DataTable = self.query_one('#queue')
# self._clear_table('#queue') self._clear_table('#queue')
# queue: list[SubSonic.Song] = [] queue: list[SubSonic.Song] = []
# queue.extend(app.user_queue) queue.extend(app.user_queue)
# queue.extend(app.song_queue) queue.extend(app.song_queue)
# for song in queue: for song in queue:
# queueTable.add_row(song.title, song.album, song.artist, song.playCount, song.duration, song.bitRate) queueTable.add_row(song.title, song.album, song.artist, song.playCount, song.duration, song.bitRate)
# Update Currently Playing Table # Update Currently Playing Table
# self._clear_table('#currently_playing') # self._clear_table('#currently_playing')
@@ -526,10 +530,12 @@ class TextualSubpyPlayer(App):
return None return None
if not self.is_paused: if not self.is_paused:
self.notify("Playback paused")
self.place = pygame.mixer.music.get_pos() self.place = pygame.mixer.music.get_pos()
pygame.mixer.music.pause() pygame.mixer.music.pause()
self.is_paused = True self.is_paused = True
else: else:
self.notify("Resuming Playback")
pygame.mixer.music.unpause() pygame.mixer.music.unpause()
self.is_paused = False self.is_paused = False
+6 -31
View File
@@ -1,31 +1,6 @@
[2025-01-31 13:21:20,325] DEBUG in selector_events: Using selector: EpollSelector [2025-01-31 16:23:25,184] DEBUG in selector_events: Using selector: EpollSelector
[2025-01-31 13:21:21,953] DEBUG in connectionpool: Starting new HTTPS connection (1): music.0x01fe.net:443 [2025-01-31 16:23:29,634] DEBUG in connectionpool: Starting new HTTPS connection (1): music.0x01fe.net:443
[2025-01-31 13:21:22,214] DEBUG in connectionpool: https://music.0x01fe.net:443 "GET /rest/getArtists?u=pseudo&t=ce19967219062b2d6e5a40d2ae290f58&s=0W8YPO7X&v=1.16.1&c=testing&f=json HTTP/1.1" 200 None [2025-01-31 16:23:30,003] DEBUG in connectionpool: https://music.0x01fe.net:443 "GET /rest/getStarred?u=pseudo&t=2b42cbdcaba623dfb792ecd48586886a&s=TE08V3N4&v=1.16.1&c=testing&f=json HTTP/1.1" 200 None
[2025-01-31 13:21:24,913] DEBUG in connectionpool: Starting new HTTPS connection (1): music.0x01fe.net:443 [2025-01-31 16:23:33,276] DEBUG in screens-test: Playing song click by C418.
[2025-01-31 13:21:25,139] DEBUG in connectionpool: https://music.0x01fe.net:443 "GET /rest/getMusicDirectory?u=pseudo&t=34a87ab75b493dfa472182a4b41747ec&s=5MIGXPAO&v=1.16.1&c=testing&f=json&id=1214cc8a41d945b23e75a62b866e51ea HTTP/1.1" 200 542 [2025-01-31 16:23:33,279] DEBUG in connectionpool: Starting new HTTPS connection (1): music.0x01fe.net:443
[2025-01-31 13:21:30,870] DEBUG in connectionpool: Starting new HTTPS connection (1): music.0x01fe.net:443 [2025-01-31 16:23:33,522] DEBUG in connectionpool: https://music.0x01fe.net:443 "GET /rest/stream?u=pseudo&t=f0e5dd3c31fa8759840dd77942454c58&s=96YM2VKG&v=1.16.1&c=testing&f=json&id=f9404467c3d016a55de86fdcdfaafb56 HTTP/1.1" 200 18475672
[2025-01-31 13:21:31,081] DEBUG in connectionpool: https://music.0x01fe.net:443 "GET /rest/getMusicDirectory?u=pseudo&t=f1113439f20afeeff39b76d2fee2277c&s=V32MLJAE&v=1.16.1&c=testing&f=json&id=85aa0df56d63c7da93c1ffa7c6cb25c1 HTTP/1.1" 200 523
[2025-01-31 13:21:33,825] DEBUG in connectionpool: Starting new HTTPS connection (1): music.0x01fe.net:443
[2025-01-31 13:21:34,049] DEBUG in connectionpool: https://music.0x01fe.net:443 "GET /rest/getMusicDirectory?u=pseudo&t=ba31d0b84406101617bc3ae5600101b7&s=W144WBO7&v=1.16.1&c=testing&f=json&id=f80b6383d767feb24333c7d460bed98c HTTP/1.1" 200 469
[2025-01-31 13:21:36,824] DEBUG in connectionpool: Starting new HTTPS connection (1): music.0x01fe.net:443
[2025-01-31 13:21:37,080] DEBUG in connectionpool: https://music.0x01fe.net:443 "GET /rest/getMusicDirectory?u=pseudo&t=a1551417874fb28ad3b5be78e97f9f36&s=7L48OXT8&v=1.16.1&c=testing&f=json&id=880d2c01595203f9c9263917c12331e3 HTTP/1.1" 200 483
[2025-01-31 13:21:40,412] DEBUG in connectionpool: Starting new HTTPS connection (1): music.0x01fe.net:443
[2025-01-31 13:21:40,666] DEBUG in connectionpool: https://music.0x01fe.net:443 "GET /rest/getAlbumList?u=pseudo&t=16d95e40869ee0e18077ccb1f73a28a8&s=2CPW4LQO&v=1.16.1&c=testing&f=json&type=alphabeticalByName&size=50&offset=0 HTTP/1.1" 200 None
[2025-01-31 13:21:40,673] DEBUG in connectionpool: Starting new HTTPS connection (1): music.0x01fe.net:443
[2025-01-31 13:21:40,889] DEBUG in connectionpool: https://music.0x01fe.net:443 "GET /rest/getAlbumList?u=pseudo&t=f7c416c6e74ccd1232e12100c5d38745&s=AX526JIZ&v=1.16.1&c=testing&f=json&type=alphabeticalByName&size=50&offset=50 HTTP/1.1" 200 None
[2025-01-31 13:21:40,894] DEBUG in connectionpool: Starting new HTTPS connection (1): music.0x01fe.net:443
[2025-01-31 13:21:41,110] DEBUG in connectionpool: https://music.0x01fe.net:443 "GET /rest/getAlbumList?u=pseudo&t=dc62432c163639523f96e8fb1020a45e&s=RZ92FCHX&v=1.16.1&c=testing&f=json&type=alphabeticalByName&size=50&offset=100 HTTP/1.1" 200 None
[2025-01-31 13:21:41,118] DEBUG in connectionpool: Starting new HTTPS connection (1): music.0x01fe.net:443
[2025-01-31 13:21:41,345] DEBUG in connectionpool: https://music.0x01fe.net:443 "GET /rest/getAlbumList?u=pseudo&t=cbca220f56688978f75e39f8c1e0b34c&s=VV0VGS8N&v=1.16.1&c=testing&f=json&type=alphabeticalByName&size=50&offset=150 HTTP/1.1" 200 None
[2025-01-31 13:21:41,351] DEBUG in connectionpool: Starting new HTTPS connection (1): music.0x01fe.net:443
[2025-01-31 13:21:41,615] DEBUG in connectionpool: https://music.0x01fe.net:443 "GET /rest/getAlbumList?u=pseudo&t=83e5bc5d05ba2955def1418e4808d13b&s=9PVVZ2M7&v=1.16.1&c=testing&f=json&type=alphabeticalByName&size=50&offset=200 HTTP/1.1" 200 None
[2025-01-31 13:21:41,621] DEBUG in connectionpool: Starting new HTTPS connection (1): music.0x01fe.net:443
[2025-01-31 13:21:41,967] DEBUG in connectionpool: https://music.0x01fe.net:443 "GET /rest/getAlbumList?u=pseudo&t=b3769b6352207cc8cd7df5e71ed7b1df&s=D0AC0RC2&v=1.16.1&c=testing&f=json&type=alphabeticalByName&size=50&offset=250 HTTP/1.1" 200 None
[2025-01-31 13:21:41,974] DEBUG in connectionpool: Starting new HTTPS connection (1): music.0x01fe.net:443
[2025-01-31 13:21:42,365] DEBUG in connectionpool: https://music.0x01fe.net:443 "GET /rest/getAlbumList?u=pseudo&t=8028565841124b478585a9f3a1ed2f3a&s=3T2ML9EF&v=1.16.1&c=testing&f=json&type=alphabeticalByName&size=50&offset=300 HTTP/1.1" 200 1923
[2025-01-31 13:21:42,369] DEBUG in connectionpool: Starting new HTTPS connection (1): music.0x01fe.net:443
[2025-01-31 13:21:42,671] DEBUG in connectionpool: https://music.0x01fe.net:443 "GET /rest/getAlbumList?u=pseudo&t=dbc99e89caf7fa468dbe28e584ce8b38&s=LGXB4UDU&v=1.16.1&c=testing&f=json&type=alphabeticalByName&size=50&offset=350 HTTP/1.1" 200 142
[2025-01-31 13:21:45,233] DEBUG in connectionpool: Starting new HTTPS connection (1): music.0x01fe.net:443
[2025-01-31 13:21:45,465] DEBUG in connectionpool: https://music.0x01fe.net:443 "GET /rest/getMusicDirectory?u=pseudo&t=daf451268a4bd853ad04c861c476baee&s=1TZHM0YY&v=1.16.1&c=testing&f=json&id=8b50e4865b5126087f09fe1bf3565612 HTTP/1.1" 200 1923
[2025-01-31 13:21:49,381] DEBUG in connectionpool: Starting new HTTPS connection (1): music.0x01fe.net:443
[2025-01-31 13:21:49,771] DEBUG in connectionpool: https://music.0x01fe.net:443 "GET /rest/getStarred?u=pseudo&t=3d7412b013b33bb44c53806cfdb4390b&s=03OPEFPW&v=1.16.1&c=testing&f=json HTTP/1.1" 200 None