From 25661816e7a373de4a5e93ff21504d532157499f Mon Sep 17 00:00:00 2001 From: DYefremov Date: Wed, 25 Jan 2023 01:00:16 +0300 Subject: [PATCH] 'replace existing' for bouquets tab --- app/ui/imports.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/ui/imports.py b/app/ui/imports.py index 963f7fec..dae8460e 100644 --- a/app/ui/imports.py +++ b/app/ui/imports.py @@ -259,8 +259,11 @@ class ImportDialog: with suppress(ValueError): bq.remove(b) - services = list(filter(lambda s: s.fav_id not in self._ids, services)) - self._append(self._bouquets, services) + self._append(self._bouquets, list(filter(lambda s: s.fav_id not in self._ids, services))) + + if self._replace_existing_switch.get_active(): + self._app.emit("services_update", {s.fav_id: s for s in filter(lambda s: s.fav_id in self._ids, services)}) + self._dialog_window.destroy() def import_satellites_data(self):