Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
weight 0 should return to default
  • Loading branch information
Glenn-1990 authored and perexg committed Nov 5, 2015
1 parent c2c80b7 commit 1b73e88
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/htsp_server.c
Expand Up @@ -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)
Expand Down
6 changes: 5 additions & 1 deletion src/subscriptions.c
Expand Up @@ -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,
Expand Down

0 comments on commit 1b73e88

Please sign in to comment.