iplayer/bamboo — pull request #77 by miguelgonz (2014-09-15 12:53:45+00:00)
Title: 19622: Cleaning the schedules feed

This PR adds filtering to the Schedule feed to weed out any broadcasts with bad information. After a long discussion with @mattjburrows it was agreed that bamboo is the best place to handle it, since once it leaves it, there's no clean way to generate empty models for the gaps between broadcasts, or change their times. Another decision that was taken time ago regarding the faulty broadcasts, which was just removing the episode in the broadcasts with bad information, so if there's an overlap, both broadcasts should be replaced with a single one, covering both times, and no episode so a "Programme information not available" error message is shown.

It tackles the following scenarios, for which there are tests included:

- Duplication. 2 consecutive broadcasts have the same start and end time. There should only be one, without an episode.
- Overlap. 2 consecutive broadcasts share part of their broadcast time. There should be only one, without an episode.
- Gaps. 2 consecutive broadcasts leave a gap in between them. There should be a new broadcast element created in between them, with no episode.
- Inside. A broadcast takes place inside the previous programme. There should only be one, without an episode, covering the longest broadcast times.

I hope it all makes sense.

https://jira.dev.bbc.co.uk/browse/IPLAYER-19622