diff --git a/quilt/module.c b/quilt/module.c index 8d42457..5a99d1a 100644 --- a/quilt/module.c +++ b/quilt/module.c @@ -29,6 +29,7 @@ char *spindle_cachepath; SQL *spindle_db; int spindle_s3_verbose; long spindle_s3_fetch_limit; +int spindle_threshold; static int spindle_cache_init_(void); static int spindle_cache_init_s3_(const char *bucket); @@ -50,6 +51,7 @@ quilt_plugin_init(void) spindle_bucket = NULL; spindle_db = NULL; spindle_cachepath = NULL; + spindle_threshold = quilt_config_get_int(QUILT_PLUGIN_NAME ":threshold", SPINDLE_THRESHOLD); if((t = quilt_config_geta(QUILT_PLUGIN_NAME ":db", NULL))) { spindle_db = sql_connect(t); diff --git a/quilt/p_spindle.h b/quilt/p_spindle.h index 018e15b..ffec118 100644 --- a/quilt/p_spindle.h +++ b/quilt/p_spindle.h @@ -129,6 +129,7 @@ extern char *spindle_cachepath; extern int spindle_s3_verbose; extern struct index_struct spindle_indices[]; extern struct mediamatch_struct spindle_mediamatch[]; +extern int spindle_threshold; int spindle_process(QUILTREQ *request); diff --git a/quilt/query.c b/quilt/query.c index 896aa2f..bc92390 100644 --- a/quilt/query.c +++ b/quilt/query.c @@ -116,9 +116,15 @@ spindle_query_request(struct query_struct *dest, QUILTREQ *request, const char * quilt_canon_set_param(request->canonical, "mode", t); } } + t = quilt_request_getparam(request, "score"); + if(t) + { + dest->score = atoi(t); + quilt_canon_set_param(request->canonical, "score", t); + } if(dest->score == -1) { - dest->score = SPINDLE_THRESHOLD; + dest->score = spindle_threshold; } return 200; }