+ if (withCover) {
+ String infoTag = getInfoTag(in, "COVER");
+ if (infoTag != null && !infoTag.trim().isEmpty()) {
+ meta.setCover(BasicSupportHelper.getImage(null, sourceInfoFile,
+ infoTag));
+ }
+ // Second chance: try to check for a cover next to the info file
+ if (meta.getCover() == null) {
+ String info = sourceInfoFile.getFile().toString();
+ if (info.endsWith(".info")) {
+ info = info.substring(0, info.length() - ".info".length());
+ String ext = "."
+ + Instance.getConfig()
+ .getString(Config.IMAGE_FORMAT_COVER)
+ .toLowerCase();
+ meta.setCover(BasicSupportHelper.getImage(null,
+ sourceInfoFile, info + ext));
+ }
+ }
+ }
+ try {
+ meta.setWords(Long.parseLong(getInfoTag(in, "WORDCOUNT")));
+ } catch (NumberFormatException e) {
+ meta.setWords(0);
+ }
+ meta.setCreationDate(getInfoTag(in, "CREATION_DATE"));
+ meta.setFakeCover(Boolean.parseBoolean(getInfoTag(in, "FAKE_COVER")));