]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
weight 0 should return to default
authorGlenn-1990 <g_christiaensen@msn.com>
Wed, 4 Nov 2015 12:18:31 +0000 (13:18 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 5 Nov 2015 19:03:55 +0000 (20:03 +0100)
src/htsp_server.c
src/subscriptions.c

index 44620bc9341732240d3e7e69529ee8c540e3ba2b..9cd626fe1ddade9e783023f7c56d6cd4066e5068 100644 (file)
@@ -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)
index ffffbe6938148450ec275782a17e1ac625d7b1a4..c5fda01b6db417c69d0589f265346e2af0f3e7b0 100644 (file)
@@ -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,