LB-1853: Import XSPF playlist files #3379
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A user on Mastodon was looking for a way to export their playlists, and someone recommended Soundiiz.
Since XSPF is a playlist interchange format (that we support exporting to), we should have a way to support importing XSPF playlists.
I refactored the existing playlist file import modal to support XSPF, parsing the file client-side with the xspf-js library before sending a JSPF document to the server.
Unfortunately, currently upon playlist creation, every track's identifier field must be a MusicBrainz recording URL, making is less useful for the use-case described above (we can still import our own exported playlist xspf file).
We should think about allowing importing JSPF with identifiers other than MB recordings, especially if it is an identifier we can potentially use for metadata, for example a Spotify URL (https://soundiiz.com/tutorial/export-spotify-to-xspf).
Also added a checkbox to make the playlist private, as we need to set that to a value before sending the JSPF to the server, for some reason.
UI screenshot to show the improved validation error messages:
