PrajwalVandana / maestro-cli

A command-line tool to play songs (or any audio, really) in the terminal.
MIT License
139 stars 6 forks source link

Interactive help during play session #11

Closed graphixillusion closed 1 month ago

graphixillusion commented 1 month ago

It should be great to display all the keyboard's shortcuts during play session by pressing "h" in the same way when you press "v" for the visualizer to appear.

PrajwalVandana commented 1 month ago

Added in latest dev commit

graphixillusion commented 1 month ago

Ok, tried the new dev build and i have a suggestion and a bug. Currently you mapped ? for the help to show on screen, and i think that pressing the h instead is more straightforward.

About the bug if i press backspace when the help is on screen during play i get a crash with this error:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\USER\scoop\apps\python\current\Scripts\maestro.exe\__main__.py", line 7, in <module>
  File "C:\Users\USER\scoop\apps\python\current\Lib\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USER\scoop\apps\python\current\Lib\site-packages\click\core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "C:\Users\USER\scoop\apps\python\current\Lib\site-packages\click\core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USER\scoop\apps\python\current\Lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USER\scoop\apps\python\current\Lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USER\scoop\apps\python\current\Lib\site-packages\maestro\main.py", line 1587, in play
    curses.wrapper(
  File "C:\Users\USER\scoop\apps\python\current\Lib\curses\__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USER\scoop\apps\python\current\Lib\site-packages\maestro\main.py", line 674, in _play
    player.song.listen_times[config.CUR_YEAR] += time_listened
    ^^^^^^^^^^^
  File "C:\Users\USER\scoop\apps\python\current\Lib\site-packages\maestro\helpers.py", line 875, in song
    return self.playlist[self.i]
           ~~~~~~~~~~~~~^^^^^^^^
IndexError: list index out of range
PrajwalVandana commented 1 month ago

Great catch, fixed in latest dev commit! (also changed help to 'h')