Open daladim opened 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
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:
content://
URI, the ContentResolver
API does not accept creating new files, but only already existing ones.
So, overwriting already existing M3U files would be kind-of easy (even though relativizing the file paths for the songs would be hacky -- note that importing M3U is hacky as well: it does not use proper path handling and comparison, but merely checks for "is the relative path included in any of the songs in the library").
💬 User story
📝 Notes
👩🔧 Technical Design Notes
Exporting as m3u file format sounds sensible
The following playlists should be considered:
🤝 Relationships