Skip to content

Commit

Permalink
save streamrelay change
Browse files Browse the repository at this point in the history
  • Loading branch information
DYefremov committed Aug 1, 2024
1 parent 384da95 commit fa1ec4c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/eparser/enigma/streamrelay.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def save(self, path):
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()])
Expand Down
8 changes: 8 additions & 0 deletions app/ui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2630,6 +2630,8 @@ def parse_bouquets(model, b_path, itr):
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
Expand Down Expand Up @@ -4475,6 +4477,7 @@ def update_streamrelay_use(self, remove):
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
Expand All @@ -4485,12 +4488,16 @@ def update_streamrelay_use(self, remove):
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
Expand Down Expand Up @@ -4535,6 +4542,7 @@ def get_data_hash(self):
""" 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 ***********************#
Expand Down

0 comments on commit fa1ec4c

Please sign in to comment.