X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=library%2FLocalLibrary.java;h=7220a3951de137f99a4a11ecc7e5f5b119abb3c1;hb=4536c5cf2d7b8e68768f90d281b3e4974cd26ae9;hp=aec89721753252783a6b3f9c3468e4afd4b7f9d1;hpb=8e7a5d0e13cb1fbbf3a2d71de99b119ef56a999c;p=fanfix.git diff --git a/library/LocalLibrary.java b/library/LocalLibrary.java index aec8972..7220a39 100644 --- a/library/LocalLibrary.java +++ b/library/LocalLibrary.java @@ -20,10 +20,10 @@ import be.nikiroo.fanfix.output.BasicOutput; import be.nikiroo.fanfix.output.BasicOutput.OutputType; import be.nikiroo.fanfix.output.InfoCover; import be.nikiroo.fanfix.supported.InfoReader; +import be.nikiroo.utils.HashUtils; import be.nikiroo.utils.IOUtils; import be.nikiroo.utils.Image; import be.nikiroo.utils.Progress; -import be.nikiroo.utils.StringUtils; /** * This {@link BasicLibrary} will store the stories locally on disk. @@ -168,11 +168,11 @@ public class LocalLibrary extends BasicLibrary { } @Override - protected int getNextId() { + protected String getNextId() { getStories(null); // make sure lastId is set synchronized (lock) { - return ++lastId; + return String.format("%03d", ++lastId); } } @@ -553,7 +553,7 @@ public class LocalLibrary extends BasicLibrary { */ private File getAuthorCoverFile(String author) { File aDir = new File(baseDir, "_AUTHORS"); - String hash = StringUtils.getMd5Hash(author); + String hash = HashUtils.md5(author); String ext = Instance.getInstance().getConfig() .getString(Config.FILE_FORMAT_IMAGE_FORMAT_COVER); return new File(aDir, hash + "." + ext.toLowerCase()); @@ -718,10 +718,6 @@ public class LocalLibrary extends BasicLibrary { } for (File infoFileOrSubdir : infoFilesAndSubdirs) { - if (pgFiles != null) { - pgFiles.setName(infoFileOrSubdir.getName()); - } - if (infoFileOrSubdir.isDirectory()) { addToStories(stories, null, infoFileOrSubdir); } else {