X-Git-Url: http://git.nikiroo.be/?p=fanfix.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Fsupported%2FInfoReader.java;h=c23024059dcae1b4dc8fe6b20b3f9a982f2212ae;hp=f84f01b27ec721c971e2dfb18381be57fcaa3df9;hb=333f0e7b5e333e8f6222881ce35398f403fc4121;hpb=2206ef66ee00ad42d806f04a7b7ad6f8cb2d8828 diff --git a/src/be/nikiroo/fanfix/supported/InfoReader.java b/src/be/nikiroo/fanfix/supported/InfoReader.java index f84f01b..c230240 100644 --- a/src/be/nikiroo/fanfix/supported/InfoReader.java +++ b/src/be/nikiroo/fanfix/supported/InfoReader.java @@ -5,6 +5,7 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; +import java.net.URL; import java.util.ArrayList; import java.util.List; @@ -22,7 +23,7 @@ public class InfoReader { InputStream in = new MarkableFileInputStream(new FileInputStream( infoFile)); try { - return createMeta(in); + return createMeta(infoFile.toURI().toURL(), in); } finally { in.close(); in = null; @@ -34,7 +35,8 @@ public class InfoReader { } } - private static MetaData createMeta(InputStream in) throws IOException { + private static MetaData createMeta(URL sourceInfoFile, InputStream in) + throws IOException { MetaData meta = new MetaData(); meta.setTitle(getInfoTag(in, "TITLE")); @@ -50,7 +52,8 @@ public class InfoReader { meta.setSubject(getInfoTag(in, "SUBJECT")); meta.setType(getInfoTag(in, "TYPE")); meta.setImageDocument(getInfoTagBoolean(in, "IMAGES_DOCUMENT", false)); - meta.setCover(BasicSupport.getImage(null, getInfoTag(in, "COVER"))); + meta.setCover(BasicSupport.getImage(null, sourceInfoFile, + getInfoTag(in, "COVER"))); if (meta.getCover() == null) { meta.setCover(BasicSupport.getDefaultCover(meta.getSubject()));