added star star keybind
This commit is contained in:
1 parent
fd622d8a65
commit
d61ef44e97
1 file changed
+15
-1
+15
-1
@@ -411,7 +411,8 @@ class CoverArtPixels(Container):
|
|||||||
class QueueTable(Widget):
|
class QueueTable(Widget):
|
||||||
|
|
||||||
BINDINGS = [
|
BINDINGS = [
|
||||||
("p", "play_queue_song()", "Play")
|
("p", "play_queue_song()", "Play"),
|
||||||
|
("f", "star_song()", "Star Song")
|
||||||
]
|
]
|
||||||
|
|
||||||
song_ids: list[str] = []
|
song_ids: list[str] = []
|
||||||
@@ -472,6 +473,14 @@ class QueueTable(Widget):
|
|||||||
# Update the visual queue table
|
# Update the visual queue table
|
||||||
self.update_queue()
|
self.update_queue()
|
||||||
|
|
||||||
|
async def action_star_song(self) -> None:
|
||||||
|
queue: list[SubSonic.Song] = app.user_queue.copy()
|
||||||
|
queue.extend(app.song_queue)
|
||||||
|
|
||||||
|
song = queue[self.selected_row_key]
|
||||||
|
|
||||||
|
asyncio.create_task(asyncio.to_thread(conn.star, song.id))
|
||||||
|
|
||||||
# Fine to be a static renderable because it's not big enough to need a scroll
|
# Fine to be a static renderable because it's not big enough to need a scroll
|
||||||
class NowPlayingInfo(Container):
|
class NowPlayingInfo(Container):
|
||||||
song = reactive[SubSonic.Song | None](None, layout=True)
|
song = reactive[SubSonic.Song | None](None, layout=True)
|
||||||
@@ -551,6 +560,7 @@ class TextualSubpyPlayer(App):
|
|||||||
("s", "skip()", "⏭"),
|
("s", "skip()", "⏭"),
|
||||||
("d", "volume_down()", "🕩"),
|
("d", "volume_down()", "🕩"),
|
||||||
("u", "volume_up()", "🕪"),
|
("u", "volume_up()", "🕪"),
|
||||||
|
("F", "star_c_song()", "Star Current Song"),
|
||||||
("f1", "switch_mode('main')", "Overview"),
|
("f1", "switch_mode('main')", "Overview"),
|
||||||
("f2", "switch_mode('artists')", "Artists"),
|
("f2", "switch_mode('artists')", "Artists"),
|
||||||
("f3", "switch_mode('albums')", "Albums"),
|
("f3", "switch_mode('albums')", "Albums"),
|
||||||
@@ -728,6 +738,10 @@ class TextualSubpyPlayer(App):
|
|||||||
self.song_queue.append(song)
|
self.song_queue.append(song)
|
||||||
self.update_queue_table()
|
self.update_queue_table()
|
||||||
|
|
||||||
|
async def action_star_c_song(self) -> None:
|
||||||
|
if self.currently_playing:
|
||||||
|
asyncio.create_task(asyncio.to_thread(conn.star, self.currently_playing.id))
|
||||||
|
|
||||||
def on_key(self, event: events.Key) -> None:
|
def on_key(self, event: events.Key) -> None:
|
||||||
logging.debug(event.key)
|
logging.debug(event.key)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user