Login
cl-remi-xspf
Login

CL-Remi-XSPF

CL-Remi-XSPF is a small library for reading and writing playlists in the XSPF (XML Sharable Playlist Format) format and the related JSPF format. It is written entirely in Common Lisp.

Wanna support Remilia? Buy me a coffee on Ko-Fi, or support me through Liberapay.

Buy Me a Coffee at ko-fi.com Donate using Liberapay

How do I get set up?

Most dependencies can be installed via Quicklisp. The CL-SDM and CL-RemiMarshal dependencies cannot, however. These can be obtained from:

Once you have the dependencies, put them (and this library) somewhere where ASDF can find them, then run this in a REPL:

(asdf:load-system :cl-remi-xspf)

Usage

(asdf:load-system :cl-remi-xspf)

;; Open an XSPF file.
(let ((pls (cl-remi-xspf:parse-playlist #P"/path/to/file.xspf" :xml)))
  ;; Print the locations for every track
  (dolist (track (cl-remi-xspf:playlist-tracks pls))
    (print (cl-remi-xspf:track-locations track)))
    
  ;; Write the playlist to disk in JSON format
  (with-open-file (out #P"/path/to/dest.json"
                       :direction :output
                       :if-does-not-exist :create
                       :if-exists :error) ;; Don't clobber existing file
    (cl-remi-xspf:write-playist pls out :json)))

  ;; Also display in the REPL as XML
  (cl-remi-xspf:write-playist-to-string pls :xml))

Development

Known Limitations

The current version does not support the <extension> tag and simply ignores it.

Style info

I use a slightly unorthodox style for my code. Aside from these differences, please use normal Lisp formatting.

How do I contribute?

  1. Go to https://chiselapp.com/user/MistressRemilia/repository/cl-remi-xspf and clone the Fossil repository.
  2. Create a new branch for your feature.
  3. Push locally to the new branch.
  4. Create a bundle with Fossil that contains your changes.
  5. Get in contact with me.

Contributors

Links and Licenses

CL-Remi-XSPF is under the GNU Affero General Public License version 3.