Added countThreshold to limit presets

Didn’t realize the presets would be so large, here’s a way of
throttling them based on the count property if we need to.
This commit is contained in:
Aaron Lidman
2013-11-25 16:39:39 -08:00
parent 453d892e05
commit dcb901e1c2
+3 -2
View File
@@ -90,7 +90,8 @@ function generateFields() {
}
function suggestionsToPresets(presets) {
var existing = {};
var existing = {},
countThreshold = 0;
for (var preset in presets) {
existing[presets[preset].name] = {
@@ -112,7 +113,7 @@ function suggestionsToPresets(presets) {
tags.name = name;
if (!existing[name]) addPreset(item, tags, name, count);
if (!existing[name] && count > countThreshold) addPreset(item, tags, name, count);
}
}
}