[PR #518] [MERGED] add playlist folders support #786

Closed
opened 2026-03-02 23:49:49 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/aome510/spotify-player/pull/518
Author: @aNNiMON
Created: 7/28/2024
Status: Merged
Merged: 8/18/2024
Merged by: @aome510

Base: masterHead: folders


📝 Commits (10+)

  • 0d9dce3 Structurize Playlist with folders hierarchy
  • 5639c25 Folders support in library playlists
  • 8cfe9c4 Folders support in browse/add track popups
  • 5e8637c Don't show actions on playlist folder
  • 27f2faa Fix warnings
  • 3475e0c Resolve code review comments
  • 6fb37d2 Use separate entities for playlist and folders
  • dc08ceb Resolve code review comments
  • 2a2ab8a Fix handling commands in other playlist windows
  • c7e97d9 Fix storing folder id state when switching pages

📊 Changes

14 files changed (+368 additions, -84 deletions)

View changed files

📝 spotify_player/src/client/mod.rs (+25 -3)
📝 spotify_player/src/command.rs (+23 -2)
📝 spotify_player/src/event/mod.rs (+7 -2)
📝 spotify_player/src/event/page.rs (+31 -10)
📝 spotify_player/src/event/popup.rs (+59 -30)
📝 spotify_player/src/event/window.rs (+34 -17)
📝 spotify_player/src/main.rs (+1 -0)
spotify_player/src/playlist_folders.rs (+64 -0)
📝 spotify_player/src/state/data.rs (+39 -4)
📝 spotify_player/src/state/model.rs (+50 -0)
📝 spotify_player/src/state/ui/page.rs (+3 -0)
📝 spotify_player/src/state/ui/popup.rs (+7 -2)
📝 spotify_player/src/ui/page.rs (+17 -7)
📝 spotify_player/src/ui/popup.rs (+8 -7)

📄 Description

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

https://github.com/user-attachments/assets/7cbf8029-f9a8-43f7-b2c8-37b169bab459

Configuration

Follow the mikez/spotify-folders installation instructions. Then run

spotifyfolders > ~/.cache/spotify-player/PlaylistFolders_cache.json

It generates a full playlist folders structure and stores to a json file, like this:

{
  "type": "folder",
  "children": [
    {
      "type": "playlist",
      "uri": "spotify:playlist:00000000000000000000"
    },
    {
      "name": "Folder name",
      "type": "folder",
      "uri": "spotify:user:aaaaaaaaaaa:folder:bbbbbbbbb",
      "children": [
        {
          "type": "playlist",
          "uri": "spotify:playlist:111111111111111111111"
        },
        {
          "type": "playlist",
          "uri": "spotify:playlist:222222222222222222222"
        }
      ]
    }
  ]
}

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/aome510/spotify-player/pull/518 **Author:** [@aNNiMON](https://github.com/aNNiMON) **Created:** 7/28/2024 **Status:** ✅ Merged **Merged:** 8/18/2024 **Merged by:** [@aome510](https://github.com/aome510) **Base:** `master` ← **Head:** `folders` --- ### 📝 Commits (10+) - [`0d9dce3`](https://github.com/aome510/spotify-player/commit/0d9dce37c2ad166f91873c1185402dc03ef18b35) Structurize Playlist with folders hierarchy - [`5639c25`](https://github.com/aome510/spotify-player/commit/5639c25fce6421a7980b68773625be2f6bfee1bb) Folders support in library playlists - [`8cfe9c4`](https://github.com/aome510/spotify-player/commit/8cfe9c4d7ed7385effeeb525337268d4ca016587) Folders support in browse/add track popups - [`5e8637c`](https://github.com/aome510/spotify-player/commit/5e8637c0e6ed066468d43e30bfcd5d3e3193468f) Don't show actions on playlist folder - [`27f2faa`](https://github.com/aome510/spotify-player/commit/27f2faa86065f1240f390735c131f6f05ec3e934) Fix warnings - [`3475e0c`](https://github.com/aome510/spotify-player/commit/3475e0cb8262aae7e7dc4279f923aac826f2fd19) Resolve code review comments - [`6fb37d2`](https://github.com/aome510/spotify-player/commit/6fb37d2613596dd3580c1b94f772dc4f6782e6bd) Use separate entities for playlist and folders - [`dc08ceb`](https://github.com/aome510/spotify-player/commit/dc08cebee704930ab1913dfc4a666d73799f0237) Resolve code review comments - [`2a2ab8a`](https://github.com/aome510/spotify-player/commit/2a2ab8a90b3781c044c8b0b9877a28600eb17f4c) Fix handling commands in other playlist windows - [`c7e97d9`](https://github.com/aome510/spotify-player/commit/c7e97d9f6cfe0c11e4e9a9d7e5a4aa600d54b2a1) Fix storing folder id state when switching pages ### 📊 Changes **14 files changed** (+368 additions, -84 deletions) <details> <summary>View changed files</summary> 📝 `spotify_player/src/client/mod.rs` (+25 -3) 📝 `spotify_player/src/command.rs` (+23 -2) 📝 `spotify_player/src/event/mod.rs` (+7 -2) 📝 `spotify_player/src/event/page.rs` (+31 -10) 📝 `spotify_player/src/event/popup.rs` (+59 -30) 📝 `spotify_player/src/event/window.rs` (+34 -17) 📝 `spotify_player/src/main.rs` (+1 -0) ➕ `spotify_player/src/playlist_folders.rs` (+64 -0) 📝 `spotify_player/src/state/data.rs` (+39 -4) 📝 `spotify_player/src/state/model.rs` (+50 -0) 📝 `spotify_player/src/state/ui/page.rs` (+3 -0) 📝 `spotify_player/src/state/ui/popup.rs` (+7 -2) 📝 `spotify_player/src/ui/page.rs` (+17 -7) 📝 `spotify_player/src/ui/popup.rs` (+8 -7) </details> ### 📄 Description 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](https://github.com/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 https://github.com/user-attachments/assets/7cbf8029-f9a8-43f7-b2c8-37b169bab459 ## Configuration Follow the [mikez/spotify-folders](https://github.com/mikez/spotify-folders) installation instructions. Then run ```bash spotifyfolders > ~/.cache/spotify-player/PlaylistFolders_cache.json ``` It generates a full playlist folders structure and stores to a json file, like this: ```json { "type": "folder", "children": [ { "type": "playlist", "uri": "spotify:playlist:00000000000000000000" }, { "name": "Folder name", "type": "folder", "uri": "spotify:user:aaaaaaaaaaa:folder:bbbbbbbbb", "children": [ { "type": "playlist", "uri": "spotify:playlist:111111111111111111111" }, { "type": "playlist", "uri": "spotify:playlist:222222222222222222222" } ] } ] } ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 23:49:49 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-player#786
No description provided.