Update nikiroo-utils, bugfixes:
[nikiroo-utils.git] / src / be / nikiroo / fanfix / library / LocalLibrary.java
index 11c36630adcef96ea73d17c8712d84495260299a..4c4542551410d06cbe9d9e074961214d64c48129 100644 (file)
@@ -122,7 +122,7 @@ public class LocalLibrary extends BasicLibrary {
                                        meta = InfoReader.readMeta(infoFile, true);
                                        return meta.getCover();
                                } catch (IOException e) {
-                                       Instance.syserr(e);
+                                       Instance.getTraceHandler().error(e);
                                }
                        }
                }
@@ -183,7 +183,7 @@ public class LocalLibrary extends BasicLibrary {
                                        InfoCover.writeInfo(newDir, name, meta);
                                        relatedFile.delete();
                                } catch (IOException e) {
-                                       Instance.syserr(e);
+                                       Instance.getTraceHandler().error(e);
                                }
                        } else {
                                relatedFile.renameTo(new File(newDir, relatedFile.getName()));
@@ -209,7 +209,7 @@ public class LocalLibrary extends BasicLibrary {
                try {
                        ImageIO.write(sourceCovers.get(source), "png", cover);
                } catch (IOException e) {
-                       Instance.syserr(e);
+                       Instance.getTraceHandler().error(e);
                        sourceCovers.remove(source);
                }
        }
@@ -383,7 +383,8 @@ public class LocalLibrary extends BasicLibrary {
                }
 
                String coverExt = "."
-                               + Instance.getConfig().getString(Config.IMAGE_FORMAT_COVER);
+                               + Instance.getConfig().getString(Config.IMAGE_FORMAT_COVER)
+                                               .toLowerCase();
                File coverFile = new File(path + coverExt);
                if (!coverFile.exists()) {
                        coverFile = new File(path.substring(0,
@@ -472,8 +473,10 @@ public class LocalLibrary extends BasicLibrary {
                                        } catch (IOException e) {
                                                // We should not have not-supported files in the
                                                // library
-                                               Instance.syserr(new IOException(
-                                                               "Cannot load file from library: " + infoFile, e));
+                                               Instance.getTraceHandler().error(
+                                                               new IOException(
+                                                                               "Cannot load file from library: "
+                                                                                               + infoFile, e));
                                        }
                                        pgFiles.add(1);
                                }
@@ -489,7 +492,7 @@ public class LocalLibrary extends BasicLibrary {
                                                        in.close();
                                                }
                                        } catch (IOException e) {
-                                               Instance.syserr(e);
+                                               Instance.getTraceHandler().error(e);
                                        }
                                }
 
@@ -516,7 +519,7 @@ public class LocalLibrary extends BasicLibrary {
                try {
                        ImageIO.write(sourceCovers.get(source), "png", cover);
                } catch (IOException e) {
-                       Instance.syserr(e);
+                       Instance.getTraceHandler().error(e);
                        sourceCovers.remove(source);
                }
        }