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 for storing data #204

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

shutosheep
Copy link

Checks if environment variable XDG_CONFIG_HOME is set and uses it as config directory. If set, data will be stored at $XDG_CONFIG_HOME/youtube-local. If not set, it will default to ~/.config/youtube-local.

Closes #193

@user234683
Copy link
Owner

user234683 commented Jun 8, 2024

Sorry for the late reply. Comments:

  1. Need to read the old paths ~/.youtube-local to see if there are configuration files in there. I.e., if there is nothing in ~/.config/youtube-local nor in the XDG directory, but there is data in the old paths, then use the old paths. Otherwise, if I push an update, people's settings and data which is currently stored there will not be loaded, creating confusion and problems
  2. I don't think data should be stored in the config folder too, we should store it in XDG_DATA_HOME which defaults to ~/.local/share, no?

@shutosheep
Copy link
Author

Need to read the old paths ~/.youtube-local to see if there are configuration files in there.

I will make it check if settings.txt file is found in old ~/.youtube-local directory. If found, it will use the old ~/.youtube-local directory and if not, use the XDG directory.

I don't think data should be stored in the config folder too, we should store it in XDG_DATA_HOME which defaults to ~/.local/share, no?

I'm not sure about this, since I have little knowledge of XDG base directory. But as far as I read the XDG Base Directory Specification, I think that your suggestion is better. I will change it to store in XDG_DATA_HOME.

- Read both XDG directory and old ~/.youtube-local directory for storing
  data
- Use XDG_DATA_HOME as XDG directory
@user234683
Copy link
Owner

  1. We should use $XDG_DATA_HOME for the data and $XDG_CONFIG_HOME for the settings, rather than using $XDG_DATA_HOME for both
  2. I realize we should stick with the old way on Windows since it doesn't use XDG. Make sure to add a check for that

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

Successfully merging this pull request may close these issues.

Store data in XDG Base Directory
2 participants