From: Niki Roo Date: Wed, 13 Mar 2019 21:00:40 +0000 (+0100) Subject: fix remote tries to import remote files X-Git-Tag: fanfix-2.0.0~54 X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=00f6344a8389698f3332767d445b8345b050a763;p=fanfix.git fix remote tries to import remote files --- diff --git a/TODO.md b/TODO.md index 19202dc..ff3396b 100644 --- a/TODO.md +++ b/TODO.md @@ -79,7 +79,7 @@ My current planning for Fanfix (but not everything appears on this list): - [ ] Fix eHentai "content warning" access - [ ] Fix the configuration system (for new or changed options, new or changed languages) - [ ] remote import also download the file in cache, why? - - [ ] import file in remote mode tries to import remote file!! + - [x] import file in remote mode tries to import remote file!! - [ ] import file does not find author in cbz with SUMMARY file - [ ] import file:// creates a tmp without auto-deletion in /tmp/fanfic-... diff --git a/src/be/nikiroo/fanfix/library/RemoteLibrary.java b/src/be/nikiroo/fanfix/library/RemoteLibrary.java index 71b65bf..75f98be 100644 --- a/src/be/nikiroo/fanfix/library/RemoteLibrary.java +++ b/src/be/nikiroo/fanfix/library/RemoteLibrary.java @@ -285,6 +285,13 @@ public class RemoteLibrary extends BasicLibrary { @Override // Could work (more slowly) without it public Story imprt(final URL url, Progress pg) throws IOException { + // Import the file locally if it is actually a file + if (url == null || url.getProtocol().equalsIgnoreCase("file")) { + return super.imprt(url, pg); + } + + // Import it remotely if it is an URL + if (pg == null) { pg = new Progress(); }