How can I change the above script from using the playlist to using a database playlist which has already been generated (say the one for tomorrow at 14:00?) and then re-save it
var
pl: IPlaylist;
begin
// Load playlist from DB:
pl := Database(0).GetPlaylist(EncodeDate(2016, 3, 13) + EncodeTime(13, 0, 0, 0), 0);
// do some work...
// then save it back to DB:
IDBConnection(Database(0)).SavePlaylist(EncodeDate(2016, 3, 13) + EncodeTime(13, 0, 0, 0), 0, pl);
end.
Saving only works for mAirListDB, thus the IDBConnection typecast. The extra “0” parameter is the sub-playlist number (0 = master playlist).
I actually need to calculate the playlist duration (as seconds) so am trying to get this by adding the calculated start time of the final item and the effective duration of final item