Given I have a video from "Film" category selected
When there is a Logo Intro selected for the playlist item
Then play Logo Intro before and after the selected video
Create intro tracks during saving the track. While it would be the most optimal way, atm we could not handle the case where saving the track itself fails since the first intro should be saved before the track to keep correct position numbering (even if we have some issues around numbering). Maybe transactions can come handy but relying a business logic on a database operation sounds terrible.
:bulb: Extend track with intro id and at playlist finalization, we expand and create a new track to the playlist. This means before finalization program book could not show the exact start/end time (as intros can push these with 1-2 min). Probably the compromise solution. We have a small impact on a feature that probably will not be used (program book for unfinished playlists aren't used anywhere currently and can be explicitly disabled the usage from code).
Modify StreamingJob to handle intros before/after the played track. It would not modify the current behavior on how tracks handled on the UI, but it has two serious problems:
StreamingJob should take care now what type of track it playing and play something else before/after. This intelligence is unwanted here as StreamingJob should be as simple as it can - it is the most untestable part of the code
As at previous, intros can affect start/end times at the program book and real-time start/end schedules should differ from the program book and could cause viewer complaint.
$TITLE
Given I have a video from "Film" category selected When there is a Logo Intro selected for the playlist item Then play Logo Intro before and after the selected video