Extract playlist as csv or xls
  • I have approximately 10 x 3-hour playlists stored in Airtime; recently I've noticed that I have some duplicate music tracks across the playlists which I'd like to find.

    Ideally what I'd like to do is print out each of the playlists so I can compare them on paper & find the duplicates.

    Is there any way I can do that?  How do I get the playlist data out?

    Thanks.
  • 4 Comments sorted by
  • We will soon have an API that will allow you to pull this information via the browser.

    In the meantime here is a primitive way to do it:

    sudo -u postgres psql airtime -c 'select id, name from cc_playlist'

    The resulting table will print out the playlists you own. Make note of the ID of each playlist.

    Now run

    sudo -u postgres psql airtime -c 'select f.artist_name, f.track_title from cc_playlistcontents pc LEFT JOIN cc_files f on pc.file_id = f.id where pc.playlist_id = X'

    and replace 'X' with the ID of the playlist whose contents you want to display :)


    Airtime Pro Hosting: http://airtime.pro
  • Even better, let the computer do the work for you :)

    select f.artist_name, f.track_title from cc_playlistcontents pc LEFT JOIN cc_files f on pc.file_id = f.id where pc.playlist_id = X and f.id in (select f.id from cc_playlistcontents pc LEFT JOIN cc_files f on pc.file_id = f.id where pc.playlist_id = Y)

    Replace X with the id of the first playlist, and Y with the id of the second playlist.
    Airtime Pro Hosting: http://airtime.pro
  • Awesome - thank you :)  Will give it a go over the weekend. 
  • "We will soon have an API that will allow you to pull this information via the browser."

    It's 2017.  Was this functionality ever created?  I am about to create a web service to export playlist info for consumption by other sites/apps and I want to make sure I'm not recreating the wheel.  Thanks.