X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Fsupported%2FText.java;h=ade797fbf71ae3182a05ced4a6f0fdbb74b1f118;hb=7949d4a5098d8554c333c9fbbda469488bc66f7e;hp=c54b6a5d44ce0a328d63451420c6a9c00a82bd3c;hpb=b990b0024113b9cd0aab28b556439ae843dd5c36;p=fanfix.git diff --git a/src/be/nikiroo/fanfix/supported/Text.java b/src/be/nikiroo/fanfix/supported/Text.java index c54b6a5..ade797f 100644 --- a/src/be/nikiroo/fanfix/supported/Text.java +++ b/src/be/nikiroo/fanfix/supported/Text.java @@ -85,7 +85,7 @@ class Text extends BasicSupport { meta.setTitle(getTitle()); meta.setAuthor(getAuthor()); - meta.setDate(getDate()); + meta.setDate(bsHelper.formatDate(getDate())); meta.setTags(new ArrayList()); meta.setSource(getType().getSourceName()); meta.setUrl(getSourceFile().toURI().toURL().toString()); @@ -97,7 +97,7 @@ class Text extends BasicSupport { meta.setType(getType().toString()); meta.setImageDocument(false); meta.setCover(getCover(getSourceFile())); - + return meta; } @@ -188,7 +188,7 @@ class Text extends BasicSupport { return content; } - private Image getCover(File sourceFile) { + protected Image getCover(File sourceFile) { String path = sourceFile.getName(); for (String ext : new String[] { ".txt", ".text", ".story" }) { @@ -317,7 +317,7 @@ class Text extends BasicSupport { } /** - * Remove the ".txt" extension if it is present. + * Remove the ".txt" (or ".text") extension if it is present. * * @param file * the file to process @@ -326,9 +326,11 @@ class Text extends BasicSupport { * was present */ protected File assureNoTxt(File file) { - if (file.getName().endsWith(".txt")) { - file = new File(file.getPath().substring(0, - file.getPath().length() - 4)); + for (String ext : new String[] { ".txt", ".text" }) { + if (file.getName().endsWith(ext)) { + file = new File(file.getPath().substring(0, + file.getPath().length() - ext.length())); + } } return file;