X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Fsupported%2FText.java;h=34f180e94c3cb16bc778313ccaeebdc5ceef0472;hb=b7cd9db81ba27c67fdd8dd5a42b5f9e4137622db;hp=cba23bf8c2f1815d2eddba3ff611ed1951b9e4b6;hpb=81b5e730677858a7e9c9fc6f2f8f7992a4b8b1c3;p=fanfix.git diff --git a/src/be/nikiroo/fanfix/supported/Text.java b/src/be/nikiroo/fanfix/supported/Text.java index cba23bf..34f180e 100644 --- a/src/be/nikiroo/fanfix/supported/Text.java +++ b/src/be/nikiroo/fanfix/supported/Text.java @@ -19,7 +19,7 @@ import be.nikiroo.fanfix.bundles.Config; import be.nikiroo.fanfix.data.MetaData; import be.nikiroo.utils.Image; import be.nikiroo.utils.ImageUtils; -import be.nikiroo.utils.MarkableFileInputStream; +import be.nikiroo.utils.streams.MarkableFileInputStream; import be.nikiroo.utils.Progress; /** @@ -67,16 +67,11 @@ class Text extends BasicSupport { return false; } - @Override - public String getSourceName() { - return "text"; - } - @Override protected Document loadDocument(URL source) throws IOException { try { sourceFile = new File(source.toURI()); - in = new MarkableFileInputStream(new FileInputStream(sourceFile)); + in = new MarkableFileInputStream(sourceFile); } catch (URISyntaxException e) { throw new IOException("Cannot load the text document: " + source); } @@ -92,7 +87,7 @@ class Text extends BasicSupport { meta.setAuthor(getAuthor()); meta.setDate(getDate()); meta.setTags(new ArrayList()); - meta.setSource(getSourceName()); + meta.setSource(getType().getSourceName()); meta.setUrl(getSourceFile().toURI().toURL().toString()); meta.setPublisher(""); meta.setUuid(getSourceFile().toString()); @@ -336,8 +331,7 @@ class Text extends BasicSupport { */ static private String detectChapter(String line, int number) { line = line.toUpperCase(); - for (String lang : Instance.getConfig().getString(Config.CHAPTER) - .split(",")) { + for (String lang : Instance.getConfig().getList(Config.CHAPTER)) { String chapter = Instance.getConfig().getStringX(Config.CHAPTER, lang); if (chapter != null && !chapter.isEmpty()) {