mirror of
https://github.com/DYefremov/DemonEditor.git
synced 2025-12-21 16:09:41 +01:00
save streamrelay change
This commit is contained in:
@@ -63,7 +63,7 @@ class StreamRelay(dict):
|
|||||||
|
|
||||||
If no refs is present, delites current relay file.
|
If no refs is present, delites current relay file.
|
||||||
"""
|
"""
|
||||||
f_name = f"{path}{_FILE_NAME}_"
|
f_name = f"{path}{_FILE_NAME}"
|
||||||
if len(self):
|
if len(self):
|
||||||
with open(f_name, "w", encoding="utf-8") as file:
|
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()])
|
file.writelines([f"{v if v else k}{':' if v else ''}\n\n" for k, v in self.items()])
|
||||||
|
|||||||
@@ -2630,6 +2630,8 @@ class Application(Gtk.Application):
|
|||||||
if profile is SettingsType.ENIGMA_2:
|
if profile is SettingsType.ENIGMA_2:
|
||||||
# Blacklist.
|
# Blacklist.
|
||||||
write_blacklist(path, self._blacklist)
|
write_blacklist(path, self._blacklist)
|
||||||
|
# Stream relay.
|
||||||
|
self._stream_relay.save(path)
|
||||||
|
|
||||||
self._save_tool_button.set_sensitive(True)
|
self._save_tool_button.set_sensitive(True)
|
||||||
yield True
|
yield True
|
||||||
@@ -4475,6 +4477,7 @@ class Application(Gtk.Application):
|
|||||||
return
|
return
|
||||||
|
|
||||||
s_types = {BqServiceType.MARKER.name, BqServiceType.SPACE.name}
|
s_types = {BqServiceType.MARKER.name, BqServiceType.SPACE.name}
|
||||||
|
count = 0
|
||||||
for p in paths:
|
for p in paths:
|
||||||
if model[p][Column.FAV_TYPE] in s_types:
|
if model[p][Column.FAV_TYPE] in s_types:
|
||||||
continue
|
continue
|
||||||
@@ -4485,12 +4488,16 @@ class Application(Gtk.Application):
|
|||||||
if remove:
|
if remove:
|
||||||
if self._stream_relay.pop(srv.fav_id, None):
|
if self._stream_relay.pop(srv.fav_id, None):
|
||||||
model[p][Column.FAV_CODED] = srv.coded
|
model[p][Column.FAV_CODED] = srv.coded
|
||||||
|
count += 1
|
||||||
else:
|
else:
|
||||||
model[p][Column.FAV_CODED] = LINK_ICON
|
model[p][Column.FAV_CODED] = LINK_ICON
|
||||||
ref = f"{self.get_service_ref_data(srv)}:"
|
ref = f"{self.get_service_ref_data(srv)}:"
|
||||||
self._stream_relay[srv.fav_id] = ref
|
self._stream_relay[srv.fav_id] = ref
|
||||||
|
count += 1
|
||||||
yield True
|
yield True
|
||||||
|
|
||||||
|
self.show_info_message(f"{translate('Count of successfully configured services:')} {count}")
|
||||||
|
|
||||||
# ***************** Profile label ********************* #
|
# ***************** Profile label ********************* #
|
||||||
|
|
||||||
@run_idle
|
@run_idle
|
||||||
@@ -4535,6 +4542,7 @@ class Application(Gtk.Application):
|
|||||||
""" Returns the sum of all data hash. """
|
""" Returns the sum of all data hash. """
|
||||||
return sum(map(hash, map(frozenset, (self._services.items(),
|
return sum(map(hash, map(frozenset, (self._services.items(),
|
||||||
self._bouquets.keys(),
|
self._bouquets.keys(),
|
||||||
|
self._stream_relay.keys(),
|
||||||
map(tuple, self._bouquets.values())))))
|
map(tuple, self._bouquets.values())))))
|
||||||
|
|
||||||
# ******************* Properties ***********************#
|
# ******************* Properties ***********************#
|
||||||
|
|||||||
Reference in New Issue
Block a user