X-Git-Url: http://git.nikiroo.be/?p=fanfix.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2FLibrary.java;h=15b81e44db7aca3caf8869f8f0b53539e1ddb8aa;hp=abe760b0d24e31862764093be7bdbcf0b670ce0d;hb=a6395bef99a8e917f67341ef1906917b87df24a4;hpb=301791d3fc0f152942b542e3d98ebddc0af528f2 diff --git a/src/be/nikiroo/fanfix/Library.java b/src/be/nikiroo/fanfix/Library.java index abe760b..15b81e4 100644 --- a/src/be/nikiroo/fanfix/Library.java +++ b/src/be/nikiroo/fanfix/Library.java @@ -194,6 +194,11 @@ public class Library { throw new IOException("Output type not supported: " + type); } + Story story = getStory(luid); + if (story == null) { + throw new IOException("Cannot find story to export: " + luid); + } + return out.process(getStory(luid), target); } @@ -227,7 +232,9 @@ public class Library { * in case of I/O error */ private Story save(Story story, String luid) throws IOException { + // Do not change the original metadata, but change the original story MetaData key = story.getMeta().clone(); + story.setMeta(key); if (luid == null || luid.isEmpty()) { getStories(); // refresh lastId if needed