From fa1ec4cdcfd54c3d47dd05bc6f8e9989a50fca67 Mon Sep 17 00:00:00 2001 From: DYefremov Date: Thu, 1 Aug 2024 07:14:24 +0300 Subject: [PATCH] save streamrelay change --- app/eparser/enigma/streamrelay.py | 2 +- app/ui/main.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/eparser/enigma/streamrelay.py b/app/eparser/enigma/streamrelay.py index a716eec3..239531ff 100644 --- a/app/eparser/enigma/streamrelay.py +++ b/app/eparser/enigma/streamrelay.py @@ -63,7 +63,7 @@ class StreamRelay(dict): If no refs is present, delites current relay file. """ - f_name = f"{path}{_FILE_NAME}_" + f_name = f"{path}{_FILE_NAME}" if len(self): with open(f_name, "w", encoding="utf-8") as file: file.writelines([f"{v if v else k}{':' if v else ''}\n\n" for k, v in self.items()]) diff --git a/app/ui/main.py b/app/ui/main.py index 1112f89d..136e55bf 100644 --- a/app/ui/main.py +++ b/app/ui/main.py @@ -2630,6 +2630,8 @@ class Application(Gtk.Application): if profile is SettingsType.ENIGMA_2: # Blacklist. write_blacklist(path, self._blacklist) + # Stream relay. + self._stream_relay.save(path) self._save_tool_button.set_sensitive(True) yield True @@ -4475,6 +4477,7 @@ class Application(Gtk.Application): return s_types = {BqServiceType.MARKER.name, BqServiceType.SPACE.name} + count = 0 for p in paths: if model[p][Column.FAV_TYPE] in s_types: continue @@ -4485,12 +4488,16 @@ class Application(Gtk.Application): if remove: if self._stream_relay.pop(srv.fav_id, None): model[p][Column.FAV_CODED] = srv.coded + count += 1 else: model[p][Column.FAV_CODED] = LINK_ICON ref = f"{self.get_service_ref_data(srv)}:" self._stream_relay[srv.fav_id] = ref + count += 1 yield True + self.show_info_message(f"{translate('Count of successfully configured services:')} {count}") + # ***************** Profile label ********************* # @run_idle @@ -4535,6 +4542,7 @@ class Application(Gtk.Application): """ Returns the sum of all data hash. """ return sum(map(hash, map(frozenset, (self._services.items(), self._bouquets.keys(), + self._stream_relay.keys(), map(tuple, self._bouquets.values()))))) # ******************* Properties ***********************#