Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use XDG Base Directory specification #226

Merged
merged 1 commit into from
Nov 7, 2021
Merged

Use XDG Base Directory specification #226

merged 1 commit into from
Nov 7, 2021

Conversation

judaew
Copy link
Contributor

@judaew judaew commented Nov 6, 2021

I think the best idea is to store non-essential files (that can be deleted without harm) in XDG_CACHE_HOME, as required by the XDG Base Directory specification.

For systems that do not have this environment variable by default (e.g. macOS), can use $HOME/.cache.

This will help reduce the number of directories in the user's home directory.

I think the best idea is to store non-essential files (that can be
deleted without harm) in XDG_CACHE_HOME, as required by the
XDG Base Directory specification.

See https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

For systems that do not have this environment variable by default, can
use ${HOME}/.cache.

This will help reduce the number of directories in the user's home
directory.
@SathyaBhat
Copy link
Owner

thank you @judaew! strictly speaking the directory is not in use at the moment but I do have plans to make use of it later, so will merge this change in.

@SathyaBhat SathyaBhat merged commit 4de5a9e into SathyaBhat:master Nov 7, 2021
@judaew judaew deleted the perf/xdg-support branch November 7, 2021 10:45
@riccardotrevisan
Copy link

The cache SAVE_PATH global constant misses a slash in merged constants.py.
Line 10 reads
SAVE_PATH = os.getenv("HOME") + ".cache/spotifydl"
should be
SAVE_PATH = os.getenv("HOME") + "/.cache/spotifydl"
otherwise results into:
FileNotFoundError: [Errno 2] No such file or directory: '/home/user.cache/spotifydl'

@judaew
Copy link
Contributor Author

judaew commented Nov 27, 2021

Thanks @riccardotrevisan 🌟

@SathyaBhat
Copy link
Owner

thanks @judaew! this is released in v8.0 https://github.com/SathyaBhat/spotify-dl/releases/tag/v8.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants