git://git.nikiroo.be
/
fanfix.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
try +1
[fanfix.git]
/
src
/
be
/
nikiroo
/
fanfix
/
library
/
LocalLibrary.java
diff --git
a/src/be/nikiroo/fanfix/library/LocalLibrary.java
b/src/be/nikiroo/fanfix/library/LocalLibrary.java
index 275926cd93164788258381b094fcef594cde7bbf..3d8aad12f904c7bc9123eccfb710507498a5f834 100644
(file)
--- a/
src/be/nikiroo/fanfix/library/LocalLibrary.java
+++ b/
src/be/nikiroo/fanfix/library/LocalLibrary.java
@@
-86,7
+86,7
@@
public class LocalLibrary extends BasicLibrary {
this.lastId = 0;
this.stories = null;
this.lastId = 0;
this.stories = null;
- this.sourceCovers = n
ew HashMap<String, Image>()
;
+ this.sourceCovers = n
ull
;
baseDir.mkdirs();
}
baseDir.mkdirs();
}
@@
-127,9
+127,14
@@
public class LocalLibrary extends BasicLibrary {
}
@Override
}
@Override
- protected synchronized void invalidateInfo(String luid) {
+ protected synchronized void updateInfo(MetaData meta) {
+ deleteInfo();
+ }
+
+ @Override
+ protected void deleteInfo(String luid) {
stories = null;
stories = null;
- sourceCovers = n
ew HashMap<String, Image>()
;
+ sourceCovers = n
ull
;
}
@Override
}
@Override
@@
-189,11
+194,15
@@
public class LocalLibrary extends BasicLibrary {
}
}
}
}
-
invalida
teInfo();
+
dele
teInfo();
}
@Override
public Image getSourceCover(String source) {
}
@Override
public Image getSourceCover(String source) {
+ if (sourceCovers == null) {
+ getStories(null);
+ }
+
if (!sourceCovers.containsKey(source)) {
sourceCovers.put(source, super.getSourceCover(source));
}
if (!sourceCovers.containsKey(source)) {
sourceCovers.put(source, super.getSourceCover(source));
}
@@
-203,6
+212,10
@@
public class LocalLibrary extends BasicLibrary {
@Override
public void setSourceCover(String source, String luid) {
@Override
public void setSourceCover(String source, String luid) {
+ if (sourceCovers == null) {
+ getStories(null);
+ }
+
sourceCovers.put(source, getCover(luid));
File cover = new File(getExpectedDir(source), ".cover");
try {
sourceCovers.put(source, getCover(luid));
File cover = new File(getExpectedDir(source), ".cover");
try {
@@
-261,15
+274,13
@@
public class LocalLibrary extends BasicLibrary {
pg.add(1);
}
pg.add(1);
}
-
invalida
teInfo();
+
dele
teInfo();
pg.done();
return;
}
}
super.imprt(other, luid, pg);
pg.done();
return;
}
}
super.imprt(other, luid, pg);
-
- invalidateInfo();
}
/**
}
/**
@@
-404,7
+415,7
@@
public class LocalLibrary extends BasicLibrary {
* {@link LocalLibrary#baseDir}.
* <p>
* Will use a cached list when possible (see
* {@link LocalLibrary#baseDir}.
* <p>
* Will use a cached list when possible (see
- * {@link BasicLibrary#
invalida
teInfo()}).
+ * {@link BasicLibrary#
dele
teInfo()}).
*
* @param pg
* the optional {@link Progress}
*
* @param pg
* the optional {@link Progress}
@@
-420,6
+431,7
@@
public class LocalLibrary extends BasicLibrary {
if (stories == null) {
stories = new HashMap<MetaData, File[]>();
if (stories == null) {
stories = new HashMap<MetaData, File[]>();
+ sourceCovers = new HashMap<String, Image>();
lastId = 0;
lastId = 0;
@@
-515,6
+527,10
@@
public class LocalLibrary extends BasicLibrary {
* the cover image
*/
void setSourceCover(String source, Image coverImage) {
* the cover image
*/
void setSourceCover(String source, Image coverImage) {
+ if (sourceCovers == null) {
+ getStories(null);
+ }
+
sourceCovers.put(source, coverImage);
File cover = new File(getExpectedDir(source), ".cover");
try {
sourceCovers.put(source, coverImage);
File cover = new File(getExpectedDir(source), ".cover");
try {