Scheduler problem
Currently when a playlist is scheduled, and then later edited, the Scheduler keeps the original duration of the playlist. This means if the playlist is edited to be longer than the original, the scheduler will cut off the playlist at the original time. If it is edited to be shorter than the original time, there will be a gap of silence between the end of the playlist and the beginning of the next.
What should happen is that the playlist time in the scheduler should be auto-adjusted so that the new ending time matches the new duration of the playlist. Any playlists that come after it should have their beginning and end times shifted appropriately. Any scheduled playlist that contains the edited playlist needs to be adjusted as well
Auto-adjust Example
Playlist A is scheduled to play from 1:00-2:00, Playlist B from 2:00-3:00, –> playlist A is edited to be 1:30 min long, so scheduler auto-adjusts playlist A to play 1:00-2:30 and playlist B to 2:30-3:30.
Nested Playlist Problem
This problem also occurs in nested playlists. The playlist has a relative start time for each item (doesn’t just say X is followed by Y). So if a playlist is contained within another playlist, these offsets need to be adjusted.
Implementation
Store the playlist info in the database. Could store all of it, or only store the containment information (which playlists are contained in other playlists). Using this info, you can look up the affected playlists and run the auto-adjustment on them.