GNOME Bugzilla – Bug 389537
XML Shareable Playlist Format for playlists
Last modified: 2009-02-26 20:23:27 UTC
Hi, http://www.xspf.org/ I think it would be great if Banshee could store playlists and the library in the XSPF ["spiff"] format from Xiph (the guys behind OGG media containers and the OGG Vorbis codec). If I have understood this correctly this is a extensible format for storing playlists, which is optimized for larger libraries and searching. Which would be great for Banshee, right? ;) Well, I think it would be great if Banshee libraries could be more easily moved and backed up. How about storing these lists in ~/Music/.Library/ and ~/Music/.Library/Playlists/ for more easily backups and synchronization between multiple machines?
There is work going on in SVN related to the Radio plugin that allows banshee to interact with XSPF formatted playlist downloaded from radio.banshee-project.org. I believe the intention is to have the ability to specify your own playlist. I haven't yet heard anything about bringing in the ability to export playlists in this sort of format or storing the playlists in a new way. Hopefully that is some useful information.
Created attachment 127679 [details] [review] Support parsing and serializing XSPF playlists Adds a new playlist format class for XSPF, supporting parsing and serialization. As an added bonus, since XSPF playlists contain <title> elements, playlists imported from XSPF can have titles preserved even if the file is renamed.
After a few quick tests, the import and export seems to work OK. I just noticed that there was already some XSPF-related code in the Libraries/Mono.Media project. Looks like it is used for Last.fm. I wonder if some of it could be re-used.
Yeah, we don't want two XSPF implementations. I forget why the Xspf code is currently in Mono.Media, but we should either use it, or get rid of it.
Created attachment 128065 [details] [review] Support parsing and serializing XSPF playlists (v2) Rewritten to use the Mono.Media code.
With your patch, compilation with mono 2.2 fails : Making all in Mono.Media make[4]: Entering directory `/home/lorentz/Projets/banshee/src/Libraries/Mono.Media' Compiling Mono.Media.dll... ./Media.Playlists.Xspf/Playlist.cs(215,16): error CS0472: The result of comparing value type `Media.Playlists.Xspf.Playlist.Date' with null is `true' Compilation failed: 1 error(s), 0 warnings make[4]: *** [../../../bin/Mono.Media.dll] Error 1 It also looks like the Sniff method you added duplicates the code at the beginning of the Load method. Would it be possible to factor this ?
Created attachment 128244 [details] [review] Support parsing and serializing XSPF playlists (v3) Moves common code for finding the xmlns and playlist node into new functions, and should fix the mono 2.2 compilation.
Thanks John, committed.