From 00f6344a8389698f3332767d445b8345b050a763 Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Wed, 13 Mar 2019 22:00:40 +0100 Subject: [PATCH] fix remote tries to import remote files --- TODO.md | 2 +- src/be/nikiroo/fanfix/library/RemoteLibrary.java | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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(); } -- 2.27.0