From ecc17fa4b23583449cde20c6a98645fd7cb42beb Mon Sep 17 00:00:00 2001 From: DYefremov Date: Thu, 8 Nov 2018 17:48:51 +0300 Subject: [PATCH] added default bouquet name --- app/eparser/enigma/bouquets.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/eparser/enigma/bouquets.py b/app/eparser/enigma/bouquets.py index 3d10f978..5138cf03 100644 --- a/app/eparser/enigma/bouquets.py +++ b/app/eparser/enigma/bouquets.py @@ -5,6 +5,7 @@ from app.eparser.ecommons import BqServiceType, BouquetService, Bouquets, Bouque _TV_ROOT_FILE_NAME = "bouquets.tv" _RADIO_ROOT_FILE_NAME = "bouquets.radio" +_DEFAULT_BOUQUET_NAME = "favourites" def get_bouquets(path): @@ -22,7 +23,11 @@ def write_bouquets(path, bouquets): line.append("#NAME {}\n".format(bqs.name)) for bq in bqs.bouquets: - bq_name = re.sub(pattern, "_", bq.name) + bq_name = bq.name + if bq_name == "Favourites (TV)" or bq_name == "Favourites (Radio)": + bq_name = _DEFAULT_BOUQUET_NAME + else: + bq_name = re.sub(pattern, "_", bq.name) line.append(srv_line.format(bq_name, bq.type)) write_bouquet(path + "userbouquet.{}.{}".format(bq_name, bq.type), bq.name, bq.services)