Skip to content

Commit d53fccf

Browse files
committed
Change most used to most directly depended upon
Fixes #110
1 parent 743bfc9 commit d53fccf

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

app/routes/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default Ember.Route.extend({
1212
};
1313
return ajax('/summary').then(function(data) {
1414
addCrates(data.new_crates);
15-
addCrates(data.most_downloaded);
15+
addCrates(data.most_directly_depended_upon);
1616
addCrates(data.just_updated);
1717
return data;
1818
});

app/templates/index.hbs

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040
<h2>New Crates</h2>
4141
{{render "crate-list" new_crates}}
4242
</div>
43-
<div id='most-downloaded'>
44-
<h2>Most Downloaded</h2>
45-
{{render "crate-list" most_downloaded}}
43+
<div id='most-depended-upon'>
44+
<h2>Most Directly Depended Upon</h2>
45+
{{render "crate-list" most_directly_depended_upon}}
4646
</div>
4747
<div id='just-updated'>
4848
<h2>Just Updated</h2>

src/krate.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -550,22 +550,22 @@ pub fn summary(req: &mut Request) -> CargoResult<Response> {
550550
WHERE updated_at::timestamp(0) !=
551551
created_at::timestamp(0)
552552
ORDER BY updated_at DESC LIMIT 10"));
553-
let most_downloaded = try!(tx.prepare("SELECT * FROM crates \
554-
ORDER BY downloads DESC LIMIT 10"));
553+
let most_directly_depended_upon = try!(tx.prepare("SELECT * FROM crates \
554+
ORDER BY dependencies-on DESC LIMIT 10"));
555555

556556
#[derive(RustcEncodable)]
557557
struct R {
558558
num_downloads: i64,
559559
num_crates: i64,
560560
new_crates: Vec<EncodableCrate>,
561-
most_downloaded: Vec<EncodableCrate>,
561+
most_directly_depended_upon: Vec<EncodableCrate>,
562562
just_updated: Vec<EncodableCrate>,
563563
}
564564
Ok(req.json(&R {
565565
num_downloads: num_downloads,
566566
num_crates: num_crates,
567567
new_crates: try!(to_crates(new_crates)),
568-
most_downloaded: try!(to_crates(most_downloaded)),
568+
most_directly_depended_upon: try!(to_crates(most_directly_depended_upon)),
569569
just_updated: try!(to_crates(just_updated)),
570570
}))
571571
}

0 commit comments

Comments
 (0)