git://git.nikiroo.be
/
nikiroo-utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'subtree'
[nikiroo-utils.git]
/
src
/
be
/
nikiroo
/
fanfix
/
library
/
RemoteLibrary.java
diff --git
a/src/be/nikiroo/fanfix/library/RemoteLibrary.java
b/src/be/nikiroo/fanfix/library/RemoteLibrary.java
index a6c68546882c0cdd64bda6c7592976d228bdfb4d..bbe772a8c90168c658fa985461e92c58f13bb8d0 100644
(file)
--- a/
src/be/nikiroo/fanfix/library/RemoteLibrary.java
+++ b/
src/be/nikiroo/fanfix/library/RemoteLibrary.java
@@
-78,7
+78,7
@@
public class RemoteLibrary extends BasicLibrary {
* <li><b>wl</b>: flag to allow access to all the stories (bypassing the
* whitelist if it exists)</li>
* </ul>
* <li><b>wl</b>: flag to allow access to all the stories (bypassing the
* whitelist if it exists)</li>
* </ul>
- *
+ *
<p>
* Some examples:
* <ul>
* <li><b>my_key</b>: normal connection, will take the default server
* Some examples:
* <ul>
* <li><b>my_key</b>: normal connection, will take the default server
@@
-124,9
+124,9
@@
public class RemoteLibrary extends BasicLibrary {
@Override
public Status getStatus() {
@Override
public Status getStatus() {
- Instance.getTraceHandler().trace("Getting remote lib status...");
+ Instance.get
Instance().get
TraceHandler().trace("Getting remote lib status...");
Status status = getStatusDo();
Status status = getStatusDo();
- Instance.getTraceHandler().trace("Remote lib status: " + status);
+ Instance.get
Instance().get
TraceHandler().trace("Remote lib status: " + status);
return status;
}
return status;
}
@@
-352,8
+352,9
@@
public class RemoteLibrary extends BasicLibrary {
@Override
// Could work (more slowly) without it
@Override
// Could work (more slowly) without it
- public
Story
imprt(final URL url, Progress pg) throws IOException {
+ public
MetaData
imprt(final URL url, Progress pg) throws IOException {
// Import the file locally if it is actually a file
// Import the file locally if it is actually a file
+
if (url == null || url.getProtocol().equalsIgnoreCase("file")) {
return super.imprt(url, pg);
}
if (url == null || url.getProtocol().equalsIgnoreCase("file")) {
return super.imprt(url, pg);
}
@@
-364,13
+365,7
@@
public class RemoteLibrary extends BasicLibrary {
pg = new Progress();
}
pg = new Progress();
}
- pg.setMinMax(0, 2);
- Progress pgImprt = new Progress();
- Progress pgGet = new Progress();
- pg.addProgress(pgImprt, 1);
- pg.addProgress(pgGet, 1);
-
- final Progress pgF = pgImprt;
+ final Progress pgF = pg;
final String[] luid = new String[1];
connectRemoteAction(new RemoteAction() {
final String[] luid = new String[1];
connectRemoteAction(new RemoteAction() {
@@
-399,11
+394,8
@@
public class RemoteLibrary extends BasicLibrary {
throw new IOException("Remote failure");
}
throw new IOException("Remote failure");
}
- Story story = getStory(luid[0], pgGet);
- pgGet.done();
-
pg.done();
pg.done();
- return
story
;
+ return
getInfo(luid[0])
;
}
@Override
}
@Override
@@
-434,7
+426,7
@@
public class RemoteLibrary extends BasicLibrary {
}
@Override
}
@Override
- public
synchronized
File getFile(final String luid, Progress pg) {
+ public File getFile(final String luid, Progress pg) {
throw new java.lang.InternalError(
"Operation not supportorted on remote Libraries");
}
throw new java.lang.InternalError(
"Operation not supportorted on remote Libraries");
}
@@
-451,12
+443,13
@@
public class RemoteLibrary extends BasicLibrary {
public void action(ConnectActionClientObject action)
throws Exception {
action.send(new Object[] { subkey, "EXIT" });
public void action(ConnectActionClientObject action)
throws Exception {
action.send(new Object[] { subkey, "EXIT" });
+ Thread.sleep(100);
}
});
}
@Override
}
});
}
@Override
- public
synchronized
MetaData getInfo(String luid) throws IOException {
+ public MetaData getInfo(String luid) throws IOException {
List<MetaData> metas = getMetasList(luid, null);
if (!metas.isEmpty()) {
return metas.get(0);
List<MetaData> metas = getMetasList(luid, null);
if (!metas.isEmpty()) {
return metas.get(0);
@@
-567,7
+560,7
@@
public class RemoteLibrary extends BasicLibrary {
@Override
protected void onError(Exception e) {
if (!(e instanceof IOException)) {
@Override
protected void onError(Exception e) {
if (!(e instanceof IOException)) {
- Instance.getTraceHandler().error(e);
+ Instance.get
Instance().get
TraceHandler().error(e);
return;
}
return;
}