Use cwd / XDG_MUSIC_DIR instead of hard-coded path
NicoWeio opened this issue · 4 comments
I think downloading to the current working directory instead of a hard-coded path would be a more sensible default.
Consider that only German-speaking fellows will have their music directory named Musik.
See master...NicoWeio:download-to-cwd for my changes.
Another option might be environment variables / xdg-user-dir MUSIC
.
Thank you for your suggestion!
I will look into it, once i find some time (maybe later this week)
So it seems to come down to calling the xdg-user-dir
subprocess
import subprocess
subprocess.check_output(['xdg-user-dir', 'MUSIC'])
which, probably only works on Unix-like systems. A solution for Windows users still has to be found.
For the output path a .config
file could come in handy, where the paths and languages to be downloaded can be configured.
Something like this:
BLINKIST_PATH=$HOME/MUSIC
BLINKIST_LANGUAGES=DE,EN
The path to this config file could be ~/.config/dailyblink/dailyblink.conf
. A Path for Windows users should still be discussed.
Maybe just environment variables are sufficient too.
Also command like arguments could be implemented to explicitly specify paths like .
for cwd
I think 5941218 adressed this issue to some extent.
I'm not sure yet if I will find the time to implement the xdg-user-dir MUSIC
approach. If someone would like to do a pull request on this matter, feel free to do so!
Less of a change but add at least an option to sets the directory ManuelSchneid3r@7894a36