FireFly Media Server › Firefly Media Server Forums › Firefly Media Server › General Discussion › Automatically create smart playlists?
- This topic has 3 replies, 3 voices, and was last updated 17 years, 5 months ago by oboeaaron.
-
AuthorPosts
-
06/06/2007 at 2:46 PM #1455oboeaaronParticipant
Hi.
Can anyone provide me with a pithy example of how to insert a smart playlist into the database from the (Unix) command line?
I am looking at writing a shell script that automatically inserts a new playlist based on path into the database whenever a folder containing music files is uploaded to the server. Here is the scenario:
1. User uploads a folder named “tracks” containing music files.
2. Server automatically detects the new folder and starts up the script.
3. Script adds a new playlist:
“tracks” {
path includes “tracks”
}1 and 2 are no problem. Most of 3 is no problem. Trouble is that I am not a DB admin and can’t make heads or tails of the info on this page:
http://trac.fireflyserver.org/wiki/SmartPlaylists
Any help greatly appreciated.
-Aaron
06/06/2007 at 2:54 PM #11064fizzeParticipantActually this has been discussed and a solution has been posted here a while ago.
Someone wrote a perl script that does just what you want. He actually inserted static playlists, because those survive a rescan, IIRC.A search in these forums should yield some insight.
07/06/2007 at 3:29 AM #11065rpeddeParticipant@oboeaaron wrote:
Hi.
Can anyone provide me with a pithy example of how to insert a smart playlist into the database from the (Unix) command line?
I am looking at writing a shell script that automatically inserts a new playlist based on path into the database whenever a folder containing music files is uploaded to the server. Here is the scenario:
1. User uploads a folder named “tracks” containing music files.
2. Server automatically detects the new folder and starts up the script.
3. Script adds a new playlist:
“tracks” {
path includes “tracks”
}1 and 2 are no problem. Most of 3 is no problem. Trouble is that I am not a DB admin and can’t make heads or tails of the info on this page:
http://trac.fireflyserver.org/wiki/SmartPlaylists
Any help greatly appreciated.
-Aaron
This: http://trac.fireflymediaserver.org/wiki/XmlApi is probably a help, too.
Something like:
$ wget http://admin:password@server:port/databases/1/containers/add?output=xml&org.mt-daapd.playlist-type=1&dmap.itemname=tracks&org.mt-daapd.smart-playlist-spec=path+includes+%22tracks%22That’s with nightlies. You could also do the same thing with sqlite, but you wouldn’t want to probably do that while the server is running.
08/06/2007 at 7:30 PM #11066oboeaaronParticipantThat’s with nightlies. You could also do the same thing with sqlite, but you wouldn’t want to probably do that while the server is running.
I should have mentioned I’m running the latest nightly. That command did the trick, though I had to place the entire argument to wget in double-quotation marks. The shell script is done and everything works great. Thanks Ron!
-Aaron
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.