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
gui: change name, author
[nikiroo-utils.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 50f9ac01fe902f272255e96da1facbd117a85178..9ebff72c2151d7d6f6e7e0f6cf86fafc42911aed 100644
(file)
--- a/
src/be/nikiroo/fanfix/library/LocalLibrary.java
+++ b/
src/be/nikiroo/fanfix/library/LocalLibrary.java
@@
-123,6
+123,10
@@
public class LocalLibrary extends BasicLibrary {
public Image getCover(String luid) {
MetaData meta = getInfo(luid);
if (meta != null) {
public Image getCover(String luid) {
MetaData meta = getInfo(luid);
if (meta != null) {
+ if (meta.getCover() != null) {
+ return meta.getCover();
+ }
+
File[] files = getStories(null).get(meta);
if (files != null) {
File infoFile = files[0];
File[] files = getStories(null).get(meta);
if (files != null) {
File infoFile = files[0];
@@
-141,11
+145,11
@@
public class LocalLibrary extends BasicLibrary {
@Override
protected synchronized void updateInfo(MetaData meta) {
@Override
protected synchronized void updateInfo(MetaData meta) {
-
dele
teInfo();
+
invalida
teInfo();
}
@Override
}
@Override
- protected void
dele
teInfo(String luid) {
+ protected void
invalida
teInfo(String luid) {
stories = null;
sourceCovers = null;
}
stories = null;
sourceCovers = null;
}
@@
-195,8
+199,8
@@
public class LocalLibrary extends BasicLibrary {
try {
String name = relatedFile.getName().replaceFirst(
"\\.info$", "");
try {
String name = relatedFile.getName().replaceFirst(
"\\.info$", "");
- InfoCover.writeInfo(newDir, name, meta);
relatedFile.delete();
relatedFile.delete();
+ InfoCover.writeInfo(newDir, name, meta);
relatedFile.getParentFile().delete();
} catch (IOException e) {
Instance.getTraceHandler().error(e);
relatedFile.getParentFile().delete();
} catch (IOException e) {
Instance.getTraceHandler().error(e);
@@
-207,7
+211,7
@@
public class LocalLibrary extends BasicLibrary {
}
}
}
}
-
dele
teInfo();
+
invalida
teInfo();
}
@Override
}
@Override
@@
-261,7
+265,9
@@
public class LocalLibrary extends BasicLibrary {
* the cover image
*/
synchronized void setSourceCover(String source, Image coverImage) {
* the cover image
*/
synchronized void setSourceCover(String source, Image coverImage) {
- File cover = new File(getExpectedDir(source), ".cover");
+ File dir = getExpectedDir(source);
+ dir.mkdirs();
+ File cover = new File(dir, ".cover");
try {
Instance.getCache().saveAsImage(coverImage, cover, true);
if (sourceCovers != null) {
try {
Instance.getCache().saveAsImage(coverImage, cover, true);
if (sourceCovers != null) {
@@
-319,7
+325,7
@@
public class LocalLibrary extends BasicLibrary {
pg.add(1);
}
pg.add(1);
}
-
dele
teInfo();
+
invalida
teInfo();
pg.done();
return;
}
pg.done();
return;
}
@@
-460,7
+466,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#
dele
teInfo()}).
+ * {@link BasicLibrary#
invalida
teInfo()}).
*
* @param pg
* the optional {@link Progress}
*
* @param pg
* the optional {@link Progress}