| View previous topic :: View next topic |
| Author |
Message |
Anonymous Guest
|
Posted: Tue Jun 06, 2006 8:25 pm Post subject: [SOLVED] iceS 0.4, perl and MySQL |
|
|
I have a very well working frontend consisting of the Holy Trinity (apache/PHP/MySQL) that 'talks' to iceS0.4 on the backend. To make a long story short, I have basically written a complete jukebox system with a playlist, sort/search functions etc. I also have a system of assigning songs as 'favorites'.
If no songs are in the playlist table, my ices.pm modules randomizes:
| Code: |
| SELECT * FROM trax ORDER BY RAND(NOW()) LIMIT 1 |
That is in the ices_get_next sub, which is invoked by
| Code: |
| kill -s SIGUSR1 ${ICES_PID} |
I want to be able to (on the fly) modify the above SQL statement to:
| Code: |
| SELECT * FROM trax WHERE `fav` = '1' ORDER BY RAND(NOW()) LIMIT 1 |
That is - I want to be able to from the frontend choose whether to randomize just my favorite tracks or from all available tracks. Will I have to hack the iceS source code and 'implement' another method, or can I modify the SIGUSR1 kill to maybe read an environmental, and based on that randomize from either the entire list or just my favorites?
I've been scouring the documentation but have come up dry so far.
Last edited by Anonymous on Thu Jun 08, 2006 3:25 am; edited 1 time in total |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Tue Jun 06, 2006 9:41 pm Post subject: |
|
|
hopefully I am not missing anything but shouldnt you just do the following:
1) Have the frontend save the option as to how to randomize (favorites or all ).... you can save this many a ways including a plain file, xml, etc
2) Have your ices.pm module read the option and generate the query accordingly.
My setup has an admin page that lets me choose a whole bunch of options as to what to pick at random. Ie: genre, track length, rating, times played, times requested, etc etc etc
anyhow hope that helps put you on track |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Tue Jun 06, 2006 11:43 pm Post subject: |
|
|
Mmm, never thought of that. I was kind of set on an interprocess kind of communication, without landing on disk (xml, txt, onion soup) first. That's a good idea. I'm going to have to give that a try.
Meanwhile - IS there a way to implement additional methods in the perl module without serious hackage to the iceS source? |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Thu Jun 08, 2006 3:25 am Post subject: |
|
|
| That worked. Thanks! |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2002 phpBB Group subRebel style by ktauber
|