From e7f7f70f7b9f66a97c282a68047371d3a51a78e6 Mon Sep 17 00:00:00 2001 From: 0x01FE Date: Thu, 23 Jan 2025 11:21:10 -0600 Subject: [PATCH] idk what im doing going to try screens --- textual-test.py | 32 ++++++++++++++------------------ textual.log | 11 ++++++++++- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/textual-test.py b/textual-test.py index 7ed3089..6391def 100644 --- a/textual-test.py +++ b/textual-test.py @@ -57,20 +57,11 @@ class TextualSubpyPlayer(App): with TabbedContent(initial="Artists"): with TabPane("Artists", id="Artists"): yield OptionList(id="Artists") + with TabPane("Albums", id="Albums"): + yield DataTable(id="Albums") yield Footer() - # yield OptionList( - # Option("Browse Artists", id="BrowseArtists"), - # Option("Browse Albums"), - # Option("Browse Songs"), - # Option("Browse Playlists"), - # id=Menus.MAIN.value - # ) - - # def on_mount(self) -> None: - # self.query_one(Tabs).allow_focus(False) - # async def action_menu_back(self) -> None: # logging.debug('Menu Back Called') # match self.lastMenu: @@ -92,21 +83,26 @@ class TextualSubpyPlayer(App): # def on_tabs_tab_activated(self, event: Tabs.TabActivated) -> None: # logging.debug(f'{event.tab.id} selected') - @on(Tabs.TabActivated) - async def artists_tab(self, event: Tabs.TabActivated) -> None: + @on(TabbedContent.TabActivated) + async def artists_tab(self, event: TabbedContent.TabActivated) -> None: if self.last_menu_type: await self.query_one(self.last_menu_type).remove() self.last_menu_type = None - logging.debug(f'{event.tab.name} tab selected') + logging.debug(f'{event.pane.id} tab selected') - id = event.tab.id + id = event.pane.id + # id = event.tab.id match id: case "Artists": - artistList: OptionList = await self._getArtistMenu() + self.artists = self.conn.getArtists() + artistList: OptionList = self.query_one(OptionList) - await self.mount(artistList) + if not artistList: + artistList: OptionList = await self._getArtistMenu() + + await self.mount(artistList) for artist in self.artists: artistList.add_option(Option(artist.name, artist.id)) @@ -122,7 +118,7 @@ class TextualSubpyPlayer(App): async def _getArtistMenu(self) -> OptionList: - self.artists = self.conn.getArtists() + # self.artists = self.conn.getArtists() return OptionList(id=Menus.ARTISTS.value) diff --git a/textual.log b/textual.log index 1290999..c74633b 100644 --- a/textual.log +++ b/textual.log @@ -1 +1,10 @@ -[2025-01-22 14:48:12,080] DEBUG in proactor_events: Using proactor: IocpProactor +[2025-01-23 11:19:08,906] DEBUG in selector_events: Using selector: EpollSelector +[2025-01-23 11:19:08,964] DEBUG in textual-test: Artists tab selected +[2025-01-23 11:19:08,966] DEBUG in connectionpool: Starting new HTTPS connection (1): music.0x01fe.net:443 +[2025-01-23 11:19:09,267] DEBUG in connectionpool: https://music.0x01fe.net:443 "GET /rest/getIndexes?u=pseudo&t=dff0ee3a818ed4cd4b15e1d30972b9de&s=419LM0NL&v=1.16.1&c=testing HTTP/1.1" 200 None +[2025-01-23 11:19:10,298] DEBUG in textual-test: Key Pressed right +[2025-01-23 11:19:10,307] DEBUG in textual-test: Albums tab selected +[2025-01-23 11:19:11,009] DEBUG in textual-test: Key Pressed left +[2025-01-23 11:19:11,015] DEBUG in textual-test: Artists tab selected +[2025-01-23 11:19:11,017] DEBUG in connectionpool: Starting new HTTPS connection (1): music.0x01fe.net:443 +[2025-01-23 11:19:11,338] DEBUG in connectionpool: https://music.0x01fe.net:443 "GET /rest/getIndexes?u=pseudo&t=df38529ec337b09026c038ea4ed94b26&s=C0ADXZ3M&v=1.16.1&c=testing HTTP/1.1" 200 None