aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjan <jan@ruken.pw>2016-10-01 18:00:20 (UTC)
committerjan <jan@ruken.pw>2016-10-01 18:00:20 (UTC)
commitb8b1da0a95635fe9ed4ba28851906556ccc351a8 (patch)
tree85bc00543b3f6175ae77ee85421959fff751d014
parent6a130458c55de738ecced00989c74cc7125e17fe (diff)
fertig.
-rw-r--r--src/character.rs7
-rw-r--r--src/main.rs2
2 files changed, 6 insertions, 3 deletions
diff --git a/src/character.rs b/src/character.rs
index 489588e..0630a45 100644
--- a/src/character.rs
+++ b/src/character.rs
@@ -85,7 +85,8 @@ impl Character {
85 let name: &Section = &sections["name".into()]; 85 let name: &Section = &sections["name".into()];
86 let image: &Section = &sections["image".into()]; 86 let image: &Section = &sections["image".into()];
87 let misc: &Section = &sections["misc".into()]; 87 let misc: &Section = &sections["misc".into()];
88 88 let tags: &Section = &sections["tags".into()];
89
89 self.name.romaji = name.data["romaji".into()].clone(); 90 self.name.romaji = name.data["romaji".into()].clone();
90 self.name.japanese = name.data["japanese".into()].clone(); 91 self.name.japanese = name.data["japanese".into()].clone();
91 92
@@ -96,7 +97,9 @@ impl Character {
96 self.image.thumb = image.data["thumb".into()].clone(); 97 self.image.thumb = image.data["thumb".into()].clone();
97 self.image.full = image.data["full".into()].clone(); 98 self.image.full = image.data["full".into()].clone();
98 99
99 self.tags = tags::parse(&(&sections["tags".into()] as &Section).data["tags_raw".into()]); 100 if tags.data.contains_key("tags_raw".into()) {
101 self.tags = tags::parse(&tags.data["tags_raw".into()]);
102 }
100 103
101 self.traits.official = dl_list::parse(&(&sections["traits"] as &Section).data["official_raw".into()]); 104 self.traits.official = dl_list::parse(&(&sections["traits"] as &Section).data["official_raw".into()]);
102 self.traits.indexed = dl_list::parse(&(&sections["traits"] as &Section).data["indexed_raw".into()]); 105 self.traits.indexed = dl_list::parse(&(&sections["traits"] as &Section).data["indexed_raw".into()]);
diff --git a/src/main.rs b/src/main.rs
index 8a3787b..2b96024 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -39,7 +39,7 @@ fn main() {
39 39
40 let files: Arc<Mutex<Vec<DirEntry>>> = Arc::new(Mutex::new(WalkDir::new(base_path).min_depth(1).into_iter().filter_map(|e| e.ok()).collect())); 40 let files: Arc<Mutex<Vec<DirEntry>>> = Arc::new(Mutex::new(WalkDir::new(base_path).min_depth(1).into_iter().filter_map(|e| e.ok()).collect()));
41 41
42 for i in 1..MAX_THREADS { 42 for i in 0..MAX_THREADS {
43 let files = files.clone(); 43 let files = files.clone();
44 let out_files = out_files.clone(); 44 let out_files = out_files.clone();
45 active_threads.fetch_add(1, Ordering::SeqCst); 45 active_threads.fetch_add(1, Ordering::SeqCst);