Quantcast

Batch playlist m3u export, or m3u sync?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Batch playlist m3u export, or m3u sync?

thatguychuck
I sync my music folder across a few devices, some of which do not have Banshee installed.  I find it helpful to export my playlists as m3u to have access to them on Banshee-less devices.  However, the process is manual, one by one.  Is there a way to batch export all my playlists as m3u? Or better yet, some sort of m3u sync that will make the changes automagically?

Regards,

Charles
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Batch playlist m3u export, or m3u sync?

alexander@polsons.info
Hi Everyone

I recently created a bash script to export all my play-lists in one go. I am happy to share it in its current form, but unfortunately I don't know how to make it into an extension. Perhaps someone finds this useful, or even could make it into an extension.

I hope I wont get into trouble for posting the text of the short script here / below?

Alex

---------------- BASH SCRIPT: exportBansheePlaylists.sh (needs sqlite3) ----------------
#!/bin/bash

DBNAME='~/.config/banshee-1/banshee.db'

sqlite3 $DBNAME 'select PlaylistID from CorePlaylists;' | while read PLID; do
   QUERY="select Name from CorePlaylists where PlaylistID = $PLID"
   NAMEORG=`sqlite3 $DBNAME "$QUERY;"`

   NAME=`echo $NAMEORG | sed 's/\ /_/g'`
   FILENAME=$NAME.m3u
   echo "Saving playlist number $PLID, $NAMEORG, to $FILENAME"

   QUERY="select Uri from CorePlaylists NATURAL JOIN CorePlaylistEntries NATURAL JOIN CoreTracks where PlaylistID =  $PLID  order by ViewOrder"
   sqlite3 $DBNAME "$QUERY;" | while read LINE; do

      echo $LINE | sed 's/file:\/\//../g' | sed 's/home\/\w\+\///g' | sed 's/\%20/\ /g' >> $FILENAME

   done

   echo --------------------------

done
Loading...