From: Glenn-1990 Date: Wed, 4 Nov 2015 12:18:31 +0000 (+0100) Subject: weight 0 should return to default X-Git-Tag: v4.2.1~1656 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1b73e880dbf43dcc09e81555128b141c03437229;p=thirdparty%2Ftvheadend.git weight 0 should return to default --- diff --git a/src/htsp_server.c b/src/htsp_server.c index 44620bc93..9cd626fe1 100644 --- a/src/htsp_server.c +++ b/src/htsp_server.c @@ -2337,7 +2337,7 @@ htsp_method_change_weight(htsp_connection_t *htsp, htsmsg_t *in) if(htsmsg_get_u32(in, "subscriptionId", &sid)) return htsp_error("Missing argument 'subscriptionId'"); - weight = htsmsg_get_u32_or_default(in, "weight", 150); + weight = htsmsg_get_u32_or_default(in, "weight", 0); LIST_FOREACH(hs, &htsp->htsp_subscriptions, hs_link) if(hs->hs_sid == sid) diff --git a/src/subscriptions.c b/src/subscriptions.c index ffffbe693..c5fda01b6 100644 --- a/src/subscriptions.c +++ b/src/subscriptions.c @@ -1004,7 +1004,11 @@ subscription_change_weight(th_subscription_t *s, int weight) LIST_REMOVE(s, ths_global_link); - s->ths_weight = weight; + if (s->ths_prch) + s->ths_weight = profile_chain_weight(s->ths_prch, weight); + else + s->ths_weight = weight; + LIST_INSERT_SORTED(&subscriptions, s, ths_global_link, subscription_sort); gtimer_arm(&subscription_reschedule_timer,