X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Foutput%2FBasicOutput.java;h=03218bcdf8f22f80404261f41998c3a19dd36722;hb=925298fd058a953144058f8b70d939c2a3e7ea5b;hp=30c2ac66642d2608391b8543af76a9366e679b9e;hpb=776ad3c6d247c6fc1b2ec683fe23e60fb3830252;p=nikiroo-utils.git diff --git a/src/be/nikiroo/fanfix/output/BasicOutput.java b/src/be/nikiroo/fanfix/output/BasicOutput.java index 30c2ac6..03218bc 100644 --- a/src/be/nikiroo/fanfix/output/BasicOutput.java +++ b/src/be/nikiroo/fanfix/output/BasicOutput.java @@ -86,7 +86,7 @@ public abstract class BasicOutput { * @return the extension */ public String getDefaultExtension(boolean readerTarget) { - BasicOutput output = BasicOutput.getOutput(this, false); + BasicOutput output = BasicOutput.getOutput(this, false, false); if (output != null) { return output.getDefaultExtension(readerTarget); } @@ -264,18 +264,18 @@ public abstract class BasicOutput { * * @param type * the new type - * @param writeInfo - * TRUE to enable the creation of a .info file * @param writeCover * TRUE to enable the creation of a cover if possible + * @param writeInfo + * TRUE to enable the creation of a .info file * * @return this */ - protected BasicOutput setType(OutputType type, boolean writeCover, - boolean writeInfo) { + protected BasicOutput setType(OutputType type, boolean writeInfo, + boolean writeCover) { this.type = type; - this.writeCover = writeCover; this.writeInfo = writeInfo; + this.writeCover = writeCover; return this; } @@ -334,6 +334,10 @@ public abstract class BasicOutput { story.getMeta().setType("" + getType()); } + System.out.println(story.getMeta().getTitle() + " -> write cover: " + + writeCover); + new Exception().printStackTrace(); + if (writeCover) { InfoCover.writeCover(targetDir, targetName, story.getMeta()); } @@ -514,29 +518,33 @@ public abstract class BasicOutput { * * @param type * the type - * @param infoCover - * force the .info file and the cover to be saved next + * @param writeCover + * TRUE to enable the creation of a cover if possible to be saved + * next to the main target file + * @param writeInfo + * TRUE to enable the creation of a .info file to be saved next * to the main target file * * @return the {@link BasicOutput} */ - public static BasicOutput getOutput(OutputType type, boolean infoCover) { + public static BasicOutput getOutput(OutputType type, boolean writeInfo, + boolean writeCover) { if (type != null) { switch (type) { case EPUB: - return new Epub().setType(type, infoCover, infoCover); + return new Epub().setType(type, writeInfo, writeCover); case TEXT: - return new Text().setType(type, true, infoCover); + return new Text().setType(type, writeInfo, true); case INFO_TEXT: return new InfoText().setType(type, true, true); case SYSOUT: return new Sysout().setType(type, false, false); case CBZ: - return new Cbz().setType(type, infoCover, infoCover); + return new Cbz().setType(type, writeInfo, writeCover); case LATEX: - return new LaTeX().setType(type, infoCover, infoCover); + return new LaTeX().setType(type, writeInfo, writeCover); case HTML: - return new Html().setType(type, infoCover, infoCover); + return new Html().setType(type, writeInfo, writeCover); } }