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 commit '738dd8c426dcc6ed2508d68b7985f68d66549889'
[nikiroo-utils.git]
/
src
/
be
/
nikiroo
/
fanfix
/
library
/
CacheLibrary.java
diff --git
a/src/be/nikiroo/fanfix/library/CacheLibrary.java
b/src/be/nikiroo/fanfix/library/CacheLibrary.java
index 019acd210d1fb3b2263db468e2c21e6e6bfd1d69..e8743b63cd9d18ca0ef0ba3316aa204433b4bf34 100644
(file)
--- a/
src/be/nikiroo/fanfix/library/CacheLibrary.java
+++ b/
src/be/nikiroo/fanfix/library/CacheLibrary.java
@@
-216,11
+216,17
@@
public class CacheLibrary extends BasicLibrary {
@Override
protected void updateInfo(MetaData meta) throws IOException {
if (meta != null && metas != null) {
@Override
protected void updateInfo(MetaData meta) throws IOException {
if (meta != null && metas != null) {
+ boolean changed = false;
for (int i = 0; i < metas.size(); i++) {
if (metas.get(i).getLuid().equals(meta.getLuid())) {
metas.set(i, meta);
for (int i = 0; i < metas.size(); i++) {
if (metas.get(i).getLuid().equals(meta.getLuid())) {
metas.set(i, meta);
+ changed = true;
}
}
}
}
+
+ if (!changed) {
+ metas.add(meta);
+ }
}
cacheLib.updateInfo(meta);
}
cacheLib.updateInfo(meta);
@@
-345,7
+351,7
@@
public class CacheLibrary extends BasicLibrary {
}
@Override
}
@Override
- public
Story
imprt(URL url, Progress pg) throws IOException {
+ public
MetaData
imprt(URL url, Progress pg) throws IOException {
if (pg == null) {
pg = new Progress();
}
if (pg == null) {
pg = new Progress();
}
@@
-356,13
+362,13
@@
public class CacheLibrary extends BasicLibrary {
pg.addProgress(pgImprt, 7);
pg.addProgress(pgCache, 3);
pg.addProgress(pgImprt, 7);
pg.addProgress(pgCache, 3);
-
Story story
= lib.imprt(url, pgImprt);
-
cacheLib.save(story, story.getMeta().getLuid(), pgCache
);
-
-
updateInfo(story.getMeta
());
-
+
MetaData meta
= lib.imprt(url, pgImprt);
+
updateInfo(meta
);
+
+
clearFromCache(meta.getLuid
());
+
pg.done();
pg.done();
- return
story
;
+ return
meta
;
}
// All the following methods are only used by Save and Delete in
}
// All the following methods are only used by Save and Delete in