Skip to content

Use XDG Base Directory for storing data - #204

Open
s10az wants to merge 3 commits into
user234683:masterfrom
s10az:xdg-base-dir
Open

Use XDG Base Directory for storing data#204
s10az wants to merge 3 commits into
user234683:masterfrom
s10az:xdg-base-dir

Conversation

@s10az

@s10az s10az commented Mar 23, 2024

Copy link
Copy Markdown

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

user234683 commented Jun 8, 2024

Copy link
Copy Markdown
Owner

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?

@s10az

s10az commented Jun 9, 2024

Copy link
Copy Markdown
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
Copy Markdown
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

@mistekko

Copy link
Copy Markdown

Bumping since it looks like s10az resolved all issues

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

3 participants