As i get so much inspiration and help from this forum, i would like to share the little bits and bytes i produce with you all.
We often produce handmade playlist as we got special rules for our music, this might result in some subjective decisions when selecting titles and some might be played to often and some never.
Here is a first test version of what i’m doing currently, all further improvements are most likely just for our spezial need, so i post just the core functionality.
First I use a typical NotificationScript to send infos to a php script(source is just to see which computer send the info).
[code]procedure OnPlayerStart(PlayerControl: IPlayerControl; Item: IPlaylistItem);
HTTPGetAsync(‘http://192.168.0.115/mairlistlog/log.php?source=MR1&title=’ + Item.GetTitle + ‘&artist=’ + Item.GetArtist );
The server saves the info to a db:
// db stuff
// convert get values
// write to db
mysql_query(“insert into logging (source,artist,title) values (’$source’,’$artist’,’$title’)”);
Now when the new playlist is put together, the following NotificationScript takes action:
var artist,title,info: String;
for i := 0 to CurrentPlaylist.GetCount - 1 do
if copy(CurrentPlaylist.GetItem(i).GetComment, 1, 7) <> ‘Checked’ then begin
title := CurrentPlaylist.GetItem(i).GetTitle;
artist := CurrentPlaylist.GetItem(i).GetArtist;
info := HTTPGet(‘http://192.168.0.115/mairlistlog/check.php?artist=’ + artist + ‘&title=’ + title);
CurrentPlaylist.GetItem(i).SetComment('Checked ’ + info);
It is getting infos from this php script:
//db connection stuff
// convert GET values
//sql query: “order by playdate desc” to get latest “playdate” in first row
$q1=mysql_query(“select * from logging where artist=’$artist’ and title=’$title’ order by playdate desc”);
// get number of results, they equal the
//get single row to know the last playdate
// return the info
echo $num.’ mal, zuletzt: '.$a1[playdate];
Now every 5 seconds the script checks how often and when last time the title that hasn’t been checked was played and writes the info into the comment row.
This is nowhere perfect, I just wanted to share some ideas and work in progress with you all.