From 1be167bec3f3f66f66ad3c13ca8644e81bf22786 Mon Sep 17 00:00:00 2001 From: DYefremov Date: Sat, 4 Mar 2023 00:27:37 +0300 Subject: [PATCH] sorting by pos on bouquets generation --- app/ui/main_helper.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/ui/main_helper.py b/app/ui/main_helper.py index a6a2ac93..99df0d45 100644 --- a/app/ui/main_helper.py +++ b/app/ui/main_helper.py @@ -610,8 +610,11 @@ def gen_bouquets(view, bq_view, transient, gen_type, s_type, callback): callback(Bouquet(cond, bq_type, s_data.get(cond)), bq_root_iter) else: # We add a bouquet only if the given name is missing [keys - names]! - for name in sorted(s_data.keys() - bq_names): - callback(Bouquet(name, BqType.TV.value, s_data.get(name)), bq_root_iter) + if gen_type is BqGenType.EACH_SAT: + bq_names = sorted(s_data.keys() - bq_names, key=get_pos_num, reverse=True) + else: + bq_names = sorted(s_data.keys() - bq_names) + [callback(Bouquet(name, BqType.TV.value, s_data.get(name)), bq_root_iter) for name in bq_names] def get_bouquets_names(model):