nathom / streamrip

A scriptable music downloader for Qobuz, Tidal, SoundCloud, and Deezer
GNU General Public License v3.0
2.6k stars 225 forks source link

[BUG] config.toml missing #684

Closed hasufytex closed 4 months ago

hasufytex commented 4 months ago

Describe the bug

The config.toml is not created in AppData on app startup, so when you try to open it through the CLI, it says there is no such file.

Command Used

C:\Users\<User>\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\Scripts> .\rip.exe config open

Debug Traceback

Opening file at C:\Users\Fytex\AppData\Roaming\streamrip\config.toml
The system cannot find the file C:\Users\User\AppData\Roaming\streamrip\config.toml.

Config File

:D

Operating System

Windows

streamrip version

rip, version 2.0.5

Screenshots and recordings

No response

Additional context

I installed the CLI tool through pip and I don't have my pip Scripts in PATH. I am able to run the CLI regardless, it's just an annoyance. Is it intended behavior (like the app being portable) and can that be fixed in future releases.

Thank you!

mortalis13 commented 4 months ago

If you can run the tool, then the config should be somewhere i guess. You have multiple users on PC? In your log you put 2 users. Do you see it the same in your console?

hasufytex commented 4 months ago

Well, in my effort to not put my username, I forgot about that in the second log. It's only 1 user and after starting the app it doesn't create a toml file there. I'm running windows 11 with the latest updates.

I checked config.py and it doesn't account for first time use. Is it somewhere else?

To reproduce what I'm doing, delete your steamrip folder in AppData (as you already have one) and run the CLI tool. It never creates a new toml config.

mortalis13 commented 4 months ago

Ok, I checked with a python installation from MS Store and it behaves like was described. Basically it redirects interaction with the configuration folder (Roaming\...) to its local sandbox, in LocalCache/Roaming is where it has its configurations (or somewhere in that region, I already removed it :)).

An example of this that I found: https://stackoverflow.com/questions/76599722/python-creates-directories-and-files-in-a-different-place-than-specified

I haven't found exactly how to manage that, but it's just a weird behaviour of the MS app(s). But anyway it's not a problem of this project code, which uses the correct path for configuration folder.

So as a quick and clean solution I'd recommend using a normal python installation if you can, from python.org, then all will be in its place.

Or put the \Roaming\streamrip folder to your user app data folder, \<User>\AppData\Roaming\. Then executing that command, the tool will open the one from that folder. Or I think the tool allows to specify any location of the config file, so put it anywhere and make a script that will point to that location always, for example.

hasufytex commented 4 months ago

That was indeed the issue. I downloaded Python from python.org and now it works as intended.