platformdirs: introduce user_music_dir()
#173
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduces the means to acquire the user's music directory path.
Feature suggested in #141. Should be the final feature needed to close the issue.
Written tests and done my own tests on Windows, MacOS, and Linux using an interactive Python shell and they produce the expected results when calling the function. As I have explained in my previous PRs I can't test Android in a similar fashion as I did the other OSs since I don't have access to an Android device.
References:
Android:
Environment.DIRECTORY_MUSIC: https://developer.android.com/reference/android/os/Environment#DIRECTORY_MUSIC/storage/emulated/0/Music: https://developer.android.com/training/data-storage/shared/media#media_storeMacOS:
~/Music: https://github.com/adrg/xdg/blob/master/README.md#xdg-user-directoriesUnix:
XDG_MUSIC_DIR&~/Music: https://wiki.archlinux.org/title/XDG_user_directories (also from the link in MacOS)Windows:
CSIDL_MYMUSICMy Music&%USERPROFILE%\Music: from regedit and https://learn.microsoft.com/en-us/windows/win32/shell/knownfolderid (search for CSIDL_MYMUSIC)