// Get the channel and date
Channel channel = getChannelFromFileName(key, channelArr, channelIdArr);
if ((channel != null) && (date != null)) {
mLog.info("Day program was deleted by third party: " + date + " on "
+ channel.getName());
ChannelDayProgram dummyProg = new MutableChannelDayProgram(date,
channel);
fireDayProgramTouched(dummyProg, null);
fireDayProgramDeleted(dummyProg);
mTvDataInventory.setUnknown(date, channel);
}
else {
// we do not know the channel of this file -> remove from list of
// remembered files
mTvDataInventory.setUnknown(key);
}
}
}
// Check whether day programs were added or replaced
for (File tvDataFile : tvDataArr) {
String fileName = tvDataFile.getName();
// Get the channel and date
Channel channel = getChannelFromFileName(fileName, channelArr,
channelIdArr);
Date date = getDateFromFileName(fileName);
if ((channel != null) && (date != null)) {
// Get the version
int version = (int) tvDataFile.length();
// Check whether this day program is known
int knownStatus = mTvDataInventory.getKnownStatus(date, channel,
version);
if ((knownStatus == TvDataInventory.UNKNOWN)
|| (knownStatus == TvDataInventory.OTHER_VERSION)) {
// do not try to read very old unknown files
if (isValidDate(date)) {
if (!somethingChanged) {
// This is the first changed day program -> fire update start
TvDataUpdater.getInstance().fireTvDataUpdateStarted();
}
// Inform the listeners
mLog.info("Day program was changed by third party: " + date + " on "
+ channel.getName());
ChannelDayProgram newDayProg = getDayProgram(date, channel, false);
if (newDayProg != null) {
handleKnownStatus(knownStatus, newDayProg, version);
}
somethingChanged = true;