Really, this issue either has to be fixed at source or your software becomes more intelligent at recognising that two programmes with the same ID either side of a short programme are in fact one continuous programme.
Thanks for your help Daniele and Happy New Year!