Version 1.3.1: UI: authors
[fanfix.git] / src / be / nikiroo / fanfix / reader / CliReader.java
index b3dd3edc79300b28c2ea779c91c887bbbbd9d704..a57de34a8e3beb403d7f2fdec1052d225aafd617 100644 (file)
@@ -9,7 +9,6 @@ import be.nikiroo.fanfix.data.Chapter;
 import be.nikiroo.fanfix.data.MetaData;
 import be.nikiroo.fanfix.data.Paragraph;
 import be.nikiroo.fanfix.data.Story;
-import be.nikiroo.fanfix.supported.BasicSupport.SupportType;
 
 /**
  * Command line {@link Story} reader.
@@ -59,7 +58,11 @@ class CliReader extends BasicReader {
        }
 
        @Override
-       public void read(int chapter) {
+       public void read(int chapter) throws IOException {
+               if (getStory() == null) {
+                       throw new IOException("No story to read");
+               }
+
                if (chapter > getStory().getChapters().size()) {
                        System.err.println("Chapter " + chapter + ": no such chapter");
                } else {
@@ -75,9 +78,9 @@ class CliReader extends BasicReader {
        }
 
        @Override
-       public void start(SupportType type) {
+       public void start(String type) {
                List<MetaData> stories;
-               stories = Instance.getLibrary().getList(type);
+               stories = Instance.getLibrary().getListByType(type);
 
                for (MetaData story : stories) {
                        String author = "";