Skip to content

Feature] Playlist Restore & Importer (from JSON/CSV) #23

@DarksAces

Description

@DarksAces

📝 Description

Currently, the Toolkit allows exporting playlist metadata to local files, but there is no reverse function to "restore" or "import" those lists back to Spotify. This feature would allow users to recover accidentally deleted playlists or migrate tracks between accounts using the files generated by the metadata_export tool.

✨ Key Features

  • File Selection: Support for reading JSON and CSV formats generated by the existing metadata_export tool.
  • Target Selection: Allow users to either create a brand new playlist or append tracks to an existing one.
  • Batch Processing: Implement logic to send tracks in chunks of 100 (Spotify API limit) to ensure stability and avoid errors.
  • Liked Songs Support: Option to import tracks directly into the user's "Liked Songs" library.

🛠 Technical Details

  • Endpoints:
    • sp.playlist_add_items(playlist_id, items_list) for playlists.
    • sp.current_user_saved_tracks_add(tracks_list) for Liked Songs.
  • Identification: Prioritize using URIs (e.g., spotify:track:ID) to ensure 100% accuracy during the restoration process.
  • Progress Tracking: Integration with the Toolkit's built-in console to show real-time progress.

👤 User Story

"As a Toolkit user, I want to be able to select a backup file I created a month ago and push it back to my Spotify account without having to search for every song manually."

🏷 Labels

enhancement, feature, priority: medium


💡 Implementation Notes

The script should be located in a new directory /playlist_import/ following the project's modular standards:

  1. Use utils.auth.get_spotify_client().
  2. Use tkinter.filedialog to provide a native file picker for the user.
  3. Validate that the selected file contains a URI or uri field before starting the process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions