Commercials placeholder with postprocessing script

We generate playlists with mAirList but using playlist files that are imported from PowerGold for music and Carmen RecPlan for commercials. But most of the time the commercials are not ready yet when playlists are generated. The feature to refresh the commercials from the weekview is very helpful, but mostly voicetracks are already recorded before commercials are planned, and when the blocks are empty mistakes are made in this due to the length of the list. So we would like to replace the commercial block with a dummy placeholder with an average length of a commercial block. Would this be possible with a postprocessing script that is loaded after the playlists are generated? I can’t really find an example of a postprocessing script to start from, so any help is really appreciated :slight_smile:

Another related question, is it possible to refresh the commercial blocks from within a script? That way we could do this on loading it into playout, to make sure we always have the most recent version.

Thanks!

Figured it out :slight_smile: Thanks to Torben for helping me out! :+1:
This is the script I use now as a postprocessing script, if it can be of help to anyone here:

var
i: integer;
pi: IPlaylistItem;
bd: TTimeValue;

begin
	CurrentPlaylist.BeginRead;
	try
	for i := 0 to CurrentPlaylist.GetCount - 1 do begin
		pi := CurrentPlaylist.GetItem(i);
		if (pi.GetItemType = pitAdvertising) and (pi.GetArtist = 'Reclame') then begin
			bd := pi.GetDuration;
			if bd = 0 then begin
				IContainerPlaylistItem(CurrentPlaylist.GetItem(i)).GetPlaylist.Add(Database(0).CreatePlaylistItem('17292'));
				SystemLog('Reclame ' + pi.GetTitle + ' vervangen door placeholder.');
			end;
		end;
	end;

	finally
	CurrentPlaylist.EndRead;
	end;
end.

Still looking for a solution to update ad containers from within a script though, haven’t found anything yet in the chm so unfortunately I don’t think it will exist… So, I know I’m being quite demanding now but, maybe a good feature request for a next snapshot? :grin: :pray: :grin:

1 Like