Support for no-chapter stories or stories with descriiption before Chatper
[nikiroo-utils.git] / supported / MangaLel.java
index 1ba51bc0f5d8a5c32a0341526a5aac142ae3fff6..de0b871331ef313b6be628c382c9487f281b5c3e 100644 (file)
@@ -32,7 +32,7 @@ class MangaLel extends BasicSupport {
 
                meta.setTitle(getTitle());
                meta.setAuthor(getAuthor());
-               meta.setDate(getDate());
+               meta.setDate(bsHelper.formatDate(getDate()));
                meta.setTags(getTags());
                meta.setSource(getType().getSourceName());
                meta.setUrl(getSource().toString());
@@ -102,15 +102,6 @@ class MangaLel extends BasicSupport {
                        }
                }
 
-               if (!value.isEmpty()) {
-                       try {
-                               long time = StringUtils.toTime(value);
-                               value = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
-                                               .format(time);
-                       } catch (ParseException e) {
-                       }
-               }
-
                return value;
        }
 
@@ -149,15 +140,14 @@ class MangaLel extends BasicSupport {
 
                                InputStream coverIn;
                                try {
-                                       coverIn = Instance.getCache().open(new URL(coverUrl), this,
-                                                       true);
+                                       coverIn = Instance.getInstance().getCache().open(new URL(coverUrl), this, true);
                                        try {
                                                return new Image(coverIn);
                                        } finally {
                                                coverIn.close();
                                        }
                                } catch (IOException e) {
-                                       Instance.getTraceHandler().error(e);
+                                       Instance.getInstance().getTraceHandler().error(e);
                                }
                        }
                }
@@ -209,7 +199,7 @@ class MangaLel extends BasicSupport {
 
                StringBuilder builder = new StringBuilder();
 
-               InputStream in = Instance.getCache().open(chapUrl, this, false);
+               InputStream in = Instance.getInstance().getCache().open(chapUrl, this, false);
                try {
                        Element pageDoc = DataUtil.load(in, "UTF-8", chapUrl.toString());
                        Element content = pageDoc.getElementById("content");