X-Git-Url: http://git.nikiroo.be/?p=fanfix.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Freader%2Fui%2FGuiReaderBookInfo.java;h=f071be02e59d559991317a57c193ab8e04e2fb81;hp=3c5cc8a22ea20daec39f79452a357702c8c9057b;hb=0bb51c9c66697fe63ba066715207deabbcc1d479;hpb=c1bb921e4435bdc48fce18be3ca808226d4930e9 diff --git a/src/be/nikiroo/fanfix/reader/ui/GuiReaderBookInfo.java b/src/be/nikiroo/fanfix/reader/ui/GuiReaderBookInfo.java index 3c5cc8a..f071be0 100644 --- a/src/be/nikiroo/fanfix/reader/ui/GuiReaderBookInfo.java +++ b/src/be/nikiroo/fanfix/reader/ui/GuiReaderBookInfo.java @@ -1,5 +1,7 @@ package be.nikiroo.fanfix.reader.ui; +import java.io.IOException; + import be.nikiroo.fanfix.bundles.StringIdGui; import be.nikiroo.fanfix.data.MetaData; import be.nikiroo.fanfix.data.Story; @@ -123,8 +125,11 @@ public class GuiReaderBookInfo { * the {@link BasicLibrary} to use to fetch the image * * @return the base image + * + * @throws IOException + * in case of I/O error */ - public Image getBaseImage(BasicLibrary lib) { + public Image getBaseImage(BasicLibrary lib) throws IOException { switch (type) { case STORY: if (meta.getCover() != null) { @@ -191,8 +196,13 @@ public class GuiReaderBookInfo { GuiReaderBookInfo info = new GuiReaderBookInfo(Type.SOURCE, "source_" + source, source); - info.count = StringUtils.formatNumber(lib.getListBySource(source) - .size()); + int size = 0; + try { + size = lib.getListBySource(source).size(); + } catch (IOException e) { + } + + info.count = StringUtils.formatNumber(size); if (!info.count.isEmpty()) { info.count = GuiReader.trans(StringIdGui.BOOK_COUNT_STORIES, info.count); @@ -216,8 +226,13 @@ public class GuiReaderBookInfo { GuiReaderBookInfo info = new GuiReaderBookInfo(Type.AUTHOR, "author_" + author, author); - info.count = StringUtils.formatNumber(lib.getListByAuthor(author) - .size()); + int size = 0; + try { + size = lib.getListByAuthor(author).size(); + } catch (IOException e) { + } + + info.count = StringUtils.formatNumber(size); if (!info.count.isEmpty()) { info.count = GuiReader.trans(StringIdGui.BOOK_COUNT_STORIES, info.count);