-
Notifications
You must be signed in to change notification settings - Fork 182
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
add playlist folders support #518
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a quick 1st pass. Looking to the linked video, pretty impressive work!
How it works
{
"type": "folder", // root node is always a folder
"children": [
{
"type": "playlist", // playlist type (contains uri)
"uri": "spotify:playlist:00000000000000000000"
},
{
"name": "Folder",
"type": "folder", // folder type (contains name, uri and 0..N children)
"uri": "spotify:user:aaaaaaaaaaa:folder:bbbbbbbbb",
"children": [ /*...*/ ]
}
]
}
playlist: Playlist 1
folder: Folder 1
playlist: Playlist 1.1
folder: Folder 1A
playlist: Playlist 1A1
playlist: Playlist 1.2
folder: Folder 1B
playlist: Playlist 1B1
playlist: Playlist 1B2
folder: Folder 2
playlist: Playlist 2.1
playlist: Playlist 2.2
spotify-player/spotify_player/src/playlist_folders.rs Lines 54 to 58 in e61b6cf
spotify-player/spotify_player/src/playlist_folders.rs Lines 65 to 70 in e61b6cf
|
Thanks for the detailed explanation. I get the idea now. Using In addition, I don't think it's a good idea to modify playlist to support representing folder because playlist and folder are separate identities. My suggestion is to define a separate struct for folder and another enum |
@aome510 for me Separate struct is okay, will do so. |
That also works. I mean Spotify ID doesn't really apply to folder, so we don't really need to differentiate here. Comments/documentations will definitely make it more clear though. |
@aome510 done |
@aNNiMON sorry for the delay (I've been kinda busy lately). I've reviewed the PR again and pushed a commit to simplify the codes and processing logic further. Can you review the commit and test it to ensure that nothing breaks in terms of functionalities? I don't have folders so couldn't really test the feature myself. |
@aome510, everything works fine. 👍 Thanks |
Resolves #453
Note
Spotify doesn't have an API to retrieve or modify playlist folders. In order to retrieve a folder structure a third party utility is required mikez/spotify-folders. Using this utility you need to create a compatible json file and put it in
~/.cache/spotify-player/PlaylistFolders_cache.json
. You'll need to update this file every time you change your folder structure.Demo
20240728_150039.mp4
Configuration
Follow the mikez/spotify-folders installation instructions. Then run
It generates a full playlist folders structure and stores to a json file, like this: