Re: [Banshee-List] Batch playlist m3u export, or m3u sync?



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




--
View this message in context: 
http://banshee-media-player.2283330.n4.nabble.com/Batch-playlist-m3u-export-or-m3u-sync-tp4651568p4652556.html
Sent from the Banshee Media Player mailing list archive at Nabble.com.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]