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
Add a test for Library (before changing it)
[fanfix.git]
/
src
/
be
/
nikiroo
/
fanfix
/
Library.java
diff --git
a/src/be/nikiroo/fanfix/Library.java
b/src/be/nikiroo/fanfix/Library.java
index 8a3895ad8c82a5c3e8e8754f3202f9da48e3edf8..3868bd3fee03d946214db55f8594f14bf34a5887 100644
(file)
--- a/
src/be/nikiroo/fanfix/Library.java
+++ b/
src/be/nikiroo/fanfix/Library.java
@@
-38,8
+38,8
@@
import be.nikiroo.utils.Progress;
public class Library {
protected File baseDir;
protected boolean localSpeed;
public class Library {
protected File baseDir;
protected boolean localSpeed;
+ protected Map<MetaData, File> stories;
- private Map<MetaData, File> stories;
private int lastId;
private OutputType text;
private OutputType image;
private int lastId;
private OutputType text;
private OutputType image;
@@
-156,17
+156,12
@@
public class Library {
*
* @return the stories
*/
*
* @return the stories
*/
- public synchronized List<MetaData> getListByType(String type) {
- if (type != null) {
- // convert the type to dir name
- type = getExpectedDir(type).getName();
- }
-
+ public synchronized List<MetaData> getListBySource(String type) {
List<MetaData> list = new ArrayList<MetaData>();
List<MetaData> list = new ArrayList<MetaData>();
- for (
Entry<MetaData, File> entry : getStories(null).entr
ySet()) {
- String storyType =
entry.getValue().getParentFile().getNam
e();
+ for (
MetaData meta : getStories(null).ke
ySet()) {
+ String storyType =
meta.getSourc
e();
if (type == null || type.equalsIgnoreCase(storyType)) {
if (type == null || type.equalsIgnoreCase(storyType)) {
- list.add(
entry.getKey()
);
+ list.add(
meta
);
}
}
}
}