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

Support XDG user directories #5333

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

Conversation

bal-e
Copy link

@bal-e bal-e commented Jun 25, 2024

Description

Fixes #5168. A simple parser for user-dirs.dirs has been implemented, and it is used to change the default music directory path when beets.Library is initialized.

To Do

  • Documentation
  • Changelog
  • Tests

Arav K. added 5 commits June 25, 2024 16:23
This can be used to receive configuration for "well known" directories
directly from the user.  In our case, only the music directory really
matters.  It's possible to implement some kind of caching system here so
that the same file doesn't get cached multiple times, but it's only used
from a single location ('beets.Library.__init__'), so it doesn't seem to
be really necessary.
Fixes beetbox#5168.  Beets will now look for a music directory as follows:

1. Configuration in 'config.yaml'.
2. On Unix-like systems, 'XDG_MUSIC_DIR' in 'user-dirs.dirs'.
3. The fallback '~/Music'.
This allows testing the lookup and parsing stages independently.
I'm not great at writing tests, but this is a good start.
@bal-e
Copy link
Author

bal-e commented Jun 25, 2024

I don't love writing (example-based) tests, so there aren't many right now. If you'd like to see some more, let me know.

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.

Beets should respect $XDG_MUSIC_DIR
1 participant