Update comment field when item is played or loaded

Hello.

Im trying to send out information to FM and DAB about what kind of news items are played from mAirlist. This is dummy files that are updated with new content every hour, and the news headlines is stored online.

I imagine that the “comment field” can be updated by receiving the correct information from SQL base or text file, and to send the “comment field” out instead of artist/title when category is “News”.

Does anyone know if it is possible to update items comment field when item is played or loaded, from external file? Ex. when national news are playing fill the comment field with text from: http://radioene.no/onair/hedmark.txt

That should be possible through a script. Where do we get the text? HTTP GET from somewhere? Text file? What would you prefer?

Cool! I think http get would be the easiest. Then we can read files o.l. with a php script when SQL not is possible. Http get will always work then.

Traverse playlist, look for item with ID 1234, and load comment via HTTP:

var 
  i: integer;

begin
  CurrentPlaylist.BeginRead;
  try
    for i := 0 to CurrentPlaylist.GetCount - 1 do
      if CurrentPlaylist.GetItem(i).GetDatabaseID = '1234' then
        CurrentPlaylist.GetItem(i).SetComment(HTTPGet('http://1.2.3.4/something.txt'));
  finally
    CurrentPlaylist.EndRead;
  end;
end.

(untested)

Ups, I didn’t tell. This is external files in region containers. Is it possible to “Set comment on this entry when file is loaded”?