themayankjha / JAKYM

JAKYM, Just Another Konsole YouTube-Music. A command line based Youtube music player written in Python with both Spotify and Youtube playlist support and easy on memory. See README for installation instructions.
https://pypi.org/project/jakym/
GNU General Public License v3.0
84 stars 7 forks source link

Saving a new playlist crash on `FileNotFound`.. #19

Open goodboy opened 1 year ago

goodboy commented 1 year ago

Probably best explained with a simple snap of the shell:

screenshot-2023-01-17_16-06-27

I'm not entirely sure what this jaylist.json file is 😂 but I guess I should try to create it beforehand?

I presume this is a bug.

goodboy commented 1 year ago

Even touch jaylist.json in that path dir still results in the same crash.

I'm not sure how exactly this is supposed to write a new playlist file; I guess i'll check the source and come back 😂

goodboy commented 1 year ago

Ahh I see now, it's not parsing the user home symbol ~ of course.

Looks like the save code's file access could use the os.path.expanduser() for this 😉

trying again with an explicit abs path (/home/<user>/...) works 😄 and the jaylist.json seems to be created automatically 🥳

it would be super nice to have tab completion for a lot of this stuff: paths for saving / loading, playlist name autocompletion, maybe search?

I wrote a comment about using python-prompt-toolkit in #13.

goodboy commented 1 year ago

Heh, similar issue with loading using the load cmd but i always get the error print output 😢

As note you shouldn't really use a bare except like that it's not kosher and you'll notice that in the python docs it's never used. Likely what you want to catch here is a FileNotFound and do the graceful print but for all other cases crash with traceback.