public static Long checkNumberOfNewLocalImages() { Long nImages = getNumberOfLocalImages(); LocalInfo localindb = LocalInfo.get((long) 1); return nImages - localindb.numberOfImages; }
public static void checkTag(Instagram instagram) { Logger.info("----TAG-----------------------"); // check if the tag is in db if (TagInfo.contains((long) 1)) { // tag found, check if it's the right tag if (TagInfo.contains(appDisplayNameTag)) { // tag is already in db, start the tag scheduler (tagWatchdog) Logger.info(" tag is in the db"); displayTagInfo(); // tag info in the db // display local folder path Logger.info(" local folder: " + urlPath); } else { // old tag is in the db, update it with the new one Logger.info(" old tag is in the db, update the old tag"); // delete the old tag, add the new tag Logger.info(" delete old tag"); TagInfo.delete((long) 1); Logger.info(" add the new tag"); TagInfo.addNew( new TagInfo(appDisplayNameTag, getNumberOfImagesByTag(instagram, appDisplayNameTag))); displayTagInfo(); // delete old images from the image db Logger.info(" delete old images"); deleteAllImagesFormDb(); // add new images to the db Logger.info(" add the new images"); addImagesToDB(instagram); // local // add new local folder info Logger.info(" delete old local info"); LocalInfo.delete((long) 1); Logger.info(" add new local info"); LocalInfo.addNew(new LocalInfo(urlPath, getNumberOfLocalImages())); Logger.info( " localPath: " + LocalInfo.get((long) 1).urlPath + " nImages: " + LocalInfo.get((long) 1).numberOfImages); // add loacal images to the db addLocalImagesToDb(); } } else { // add the new tag to db Logger.info(" tag is not in the db"); Logger.info(" add the new tag"); TagInfo.addNew( new TagInfo(appDisplayNameTag, getNumberOfImagesByTag(instagram, appDisplayNameTag))); displayTagInfo(); // add images of the new tag to the db Logger.info(" add the new images"); addImagesToDB(instagram); // local // add local folder info Logger.info(" add new local info"); LocalInfo.addNew(new LocalInfo(urlPath, getNumberOfLocalImages())); Logger.info( " localPath: " + LocalInfo.get((long) 1).urlPath + " nImages: " + LocalInfo.get((long) 1).numberOfImages); // add loacal images to the db addLocalImagesToDb(); } } // checkTag