timusus / Shuttle2

Shuttle Music Player 2.0
Other
198 stars 14 forks source link

Ability to export playlists #112

Open daladim opened 1 year ago

daladim commented 1 year ago

💬 User story

I am a user who edits playlists.
I'd like to export these modified playlists

📝 Notes

👩‍🔧 Technical Design Notes

Exporting as m3u file format sounds sensible

The following playlists should be considered:

🤝 Relationships

daladim commented 1 year ago

We could also start by providing an Export to file... (+ an associated "choose folder" dialog) in the overflow menu of every playlist (local or remote, created or already existing).

Then, adding specific logic for local playlists imported by S2 Media Provider would be easy, we'll just have to call the new playlist.export(file_path) function, with the original file path

daladim commented 1 year ago

Well, this is more complicated at it seemed at first sight.

M3U files contain either absolute paths, absolute web URLs, or relative paths. The S2 Media Provider uses neither of them, as it uses content:// URIs, and there is no API to convert it to actual paths, let alone to relativize them to the folder the M3U is stored into.

Also, we'll need to create and OutputStream to write the M3U file: