// Check whether this day program is known
int version = (int) file.length();
int knownStatus = mTvDataInventory.getKnownStatus(date, channel, version);
OnDemandDayProgramFile oldProgFile = getCacheEntry(date, channel, false, false);
MutableChannelDayProgram checkProg = (MutableChannelDayProgram)getDayProgram(date,channel,true);
boolean somethingChanged = calculateMissingLengths(checkProg);
Object oldProg = null;
if((oldProg = mNewDayProgramsAfterUpdate.remove(key)) != null) {
// Inform the listeners about deleting the old program
if (oldProg instanceof ChannelDayProgram) {
fireDayProgramDeleted((ChannelDayProgram)oldProg);
}
// Inform the listeners about adding the new program
fireDayProgramAdded(checkProg);
}
else if(somethingChanged){
fireDayProgramAdded(checkProg);
}
if (checkProg.getAndResetChangedByPluginState() || somethingChanged) {
// Some missing lengths could now be calculated
// -> Try to save the changes
// We use a temporary file. If saving succeeds we rename it
File tempFile = new File(file.getAbsolutePath() + ".changed");