@Override protected void addField(final ProgramFieldType fieldType, String value) { if (fieldType.equals(ProgramFieldType.DESCRIPTION_TYPE)) { if (((DataHydraChannelGroup) mChannel.getGroup()).isShowRegister() && mDataService.getShowRegisterText()) { value += "\n\n" + mLocalizer.msg("register", "Please Register at {0}", mChannel.getWebpage()); } } mProgram.setTextField(fieldType, value); if (fieldType.equals(ProgramFieldType.TITLE_TYPE)) { mProgram.setTitle(value); } }
@Override protected void addField(final ProgramFieldType fieldType, final int value) { if (fieldType.getFormat() == ProgramFieldType.TIME_FORMAT) { mProgram.setTimeField(fieldType, value); } else { mProgram.setIntField(fieldType, value); } if (fieldType.equals(ProgramFieldType.END_TIME_TYPE)) { int endTime = value; int startTime = mProgram.getTimeField(ProgramFieldType.START_TIME_TYPE); int progLength = endTime - startTime; // Assumption: If the program length is less than 0, the program spans // midnight if (progLength < 0) { progLength += 24 * 60; // adding 24 hours to the length } // Only allow program length for 12 hours.... This will take care of // possible DST problems if ((progLength > 0) && (progLength < 12 * 60)) { mProgram.setLength(progLength); } } }