little iptv and ui changes

This commit is contained in:
DYefremov
2017-12-16 10:29:51 +03:00
parent 9f71b59f9b
commit 54c7f32d53
4 changed files with 14 additions and 10 deletions

View File

@@ -46,11 +46,13 @@ def write_bouquet(path, name, bq_type, channels):
def to_bouquet_id(ch):
""" Creates bouquet channel id """
data_type = int(ch.data_id.split(":")[-2])
if data_type == 22:
data_type = 16
elif data_type == 25:
data_type = 19
data_type = ch.data_id
if data_type:
data_type = int(ch.data_id.split(":")[-2])
if data_type == 22:
data_type = 16
elif data_type == 25:
data_type = 19
service = "{}:0:{}:{}:0:0:0:".format(1, data_type, ch.fav_id)
return service
@@ -62,11 +64,12 @@ def get_bouquet(path, name, bq_type):
chs_list = file.read()
ids = []
for ch in list(filter(lambda x: len(x) > 1, chs_list.split("#SERVICE")[1:])): # filtering ['']
if "#DESCRIPTION" in ch: # IPTV
if "#DESCRIPTION" in ch:
ids.append("#SERVICE{}".format(ch))
else:
ch_data = ch.strip().split(":")
ids.append("{}:{}:{}:{}".format(ch_data[3], ch_data[4], ch_data[5], ch_data[6]))
if len(ch_data) > 5:
ids.append("{}:{}:{}:{}".format(ch_data[3], ch_data[4], ch_data[5], ch_data[6]))
return ids

View File

@@ -5,8 +5,8 @@ from gi.repository import Gtk, Gdk
theme = Gtk.IconTheme.get_default()
_IMAGE_MISSING = theme.load_icon("image-missing", 16, 0) if theme.lookup_icon("image-missing", 16, 0) else None
CODED_ICON = theme.load_icon("gtk-dialog-authentication-panel", 16, 0) if theme.lookup_icon(
"gtk-dialog-authentication-panel", 16, 0) else _IMAGE_MISSING
CODED_ICON = theme.load_icon("emblem-readonly", 16, 0) if theme.lookup_icon(
"emblem-readonly", 16, 0) else _IMAGE_MISSING
LOCKED_ICON = theme.load_icon("system-lock-screen", 16, 0) if theme.lookup_icon(
"system-lock-screen", 16, 0) else _IMAGE_MISSING
HIDE_ICON = theme.load_icon("go-jump", 16, 0) if theme.lookup_icon("go-jump", 16, 0) else _IMAGE_MISSING

View File

@@ -460,6 +460,7 @@ class MainAppWindow:
if "#DESCRIPTION" in srv:
fav_id, sep, name = str(srv).partition("#DESCRIPTION")
name = name.strip() if ":" not in name else name.strip()[1:]
ch_type = "IPTV" if "http" in fav_id else None
aggr = [None] * 8
self.__channels[srv] = Channel(*aggr[0:3], name, *aggr[0:3], "IPTV", *aggr, srv, None)

View File

@@ -1109,7 +1109,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">5</property>
<property name="icon_name">gtk-dialog-authentication-panel</property>
<property name="icon_name">emblem-readonly</property>
</object>
<packing>
<property name="expand">False</property>