mission.setStatus(2);
}
MissionModel.insert(mission);
}
} else if (action.equals("follow")) {
MissionModel model = new MissionModel();
model.getListNotCompleteByType(1);
List<Mission> listMission = model.getListResult();
if (listMission != null && listMission.size() > 0) {
YoutubeActiveService activeService = new YoutubeActiveService();
for (Mission mission : listMission) {
List<String> tubeIds = mission.getTubeIds();
if (tubeIds.size() == 0) {
activeService.getActiveByChannel(mission
.getSearchKeyword());
List<UserEventEntry> listResult = activeService
.getListResult();
if (listResult != null && listResult.size() > 0) {
tubeIds = new ArrayList<String>();
for (UserEventEntry entry : listResult) {
tubeIds.add(entry.getVideoId());
}
}
mission.setTubeIds(tubeIds);
mission.setUpdated(Calendar.getInstance()
.getTime());
MissionModel.insert(mission);
}
}
}
} else if (action.equals("getFollow")) {
MissionModel model = new MissionModel();
model.getListNotCompleteByType(1);
List<Mission> listMission = model.getListResult();
if (listMission != null && listMission.size() > 0) {
for (Mission mission : listMission) {
if (mission != null && mission.getId().length() > 0) {
List<String> tubeIds = new ArrayList<String>();
for (String string : mission.getTubeIds()) {