- String path = file.getPath().toLowerCase();
- if (!path.endsWith(".info")
- && !path.endsWith(format)) {
- // TODO: export .info reading to a class and use
- // it here
- SupportType type = SupportType.INFO_TEXT;
- if (path.toLowerCase().endsWith(".cbz")) {
- type = SupportType.CBZ;
- }
- BasicSupport support = BasicSupport
- .getSupport(type);
- MetaData meta = support.processMeta(
- file.toURI().toURL()).getMeta();
- if (meta != null) {
- stories.put(meta, file);
- try {
- int id = Integer.parseInt(meta
- .getLuid());
- if (id > lastId) {
- lastId = id;
- }
- } catch (Exception e) {
- // not normal!!
- Instance.syserr(new IOException(
- "Cannot understand the LUID of "
- + file.getPath() + ": "
- + meta.getLuid(), e));
+ if (file.getPath().toLowerCase().endsWith(ext)) {
+ MetaData meta = InfoReader.readMeta(file);
+ try {
+ int id = Integer.parseInt(meta.getLuid());
+ if (id > lastId) {
+ lastId = id;