From 5e64605be6a361030695268db90c3341cd4cb35d Mon Sep 17 00:00:00 2001 From: DYefremov Date: Sun, 23 Jan 2022 14:24:50 +0300 Subject: [PATCH] minor changes in saving the EPG link mapping list (#59) --- app/tools/epg.py | 6 +++--- app/ui/epg.py | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/tools/epg.py b/app/tools/epg.py index 7a3fec60..5adf8dbf 100644 --- a/app/tools/epg.py +++ b/app/tools/epg.py @@ -90,14 +90,14 @@ class ChannelsParser: srv_type = srv.type if srv_type is BqServiceType.IPTV: channel_child = doc.createElement("channel") - channel_child.setAttribute("id", str(srv.num)) + channel_child.setAttribute("id", srv.name) data = srv.data.strip().split(":") channel_child.appendChild(doc.createTextNode(":".join(data[:10]))) comment = doc.createComment(srv.name) - lines.append("{} {}\n".format(str(channel_child.toxml()), str(comment.toxml()))) + lines.append(f"{channel_child.toxml()} {comment.toxml()}\n") elif srv_type is BqServiceType.MARKER: comment = doc.createComment(srv.name) - lines.append("{}\n".format(str(comment.toxml()))) + lines.append(f"{comment.toxml()}\n") lines.append("") doc.unlink() diff --git a/app/ui/epg.py b/app/ui/epg.py index b3e33adc..b948f4f2 100644 --- a/app/ui/epg.py +++ b/app/ui/epg.py @@ -305,7 +305,7 @@ class EpgDialog: else: if refs: s_refs = filter(lambda x: x.num in refs, s_refs) - list(map(lambda s: self._services_model.append((s.name, s.data)), s_refs)) + list(map(lambda s: self._services_model.append((s.name, " ", s.data)), s_refs)) self.update_source_info(info) self.update_source_count_info() yield True @@ -403,7 +403,8 @@ class EpgDialog: self._services[new_fav_id] = service row[Column.FAV_ID] = new_fav_id row[Column.FAV_LOCKED] = EPG_ICON - src = f"{get_message('EPG source')}: {data[0]} ({data[1]})" + pos = f"({data[1] if self._refs_source is RefsSource.SERVICES else 'XML'})" + src = f"{get_message('EPG source')}: {data[0]} {pos}" row[Column.FAV_TOOLTIP] = f"{get_message('Service reference')}: {':'.join(fav_id_data[:10])}\n{src}" def on_filter_toggled(self, button: Gtk.ToggleButton):