mirror of
https://github.com/DYefremov/DemonEditor.git
synced 2025-12-20 23:49:41 +01:00
added lock support for iptv
This commit is contained in:
@@ -1286,12 +1286,18 @@ class Application(Gtk.Application):
|
||||
if s_type in (BqServiceType.MARKER, BqServiceType.IPTV, BqServiceType.SPACE):
|
||||
icon = None
|
||||
picon_id = None
|
||||
data_id = srv.num
|
||||
locked = None
|
||||
|
||||
if s_type is BqServiceType.IPTV:
|
||||
icon = IPTV_ICON
|
||||
id_data = fav_id.lstrip().split(":")
|
||||
picon_id = "{}_{}_{}_{}_{}_{}_{}_{}_{}_{}.png".format(*id_data[0:10])
|
||||
srv = Service(*agr[0:2], icon, srv.name, *agr[0:3], s_type.name, self._picons.get(picon_id, None),
|
||||
picon_id, *agr, srv.num, fav_id, None)
|
||||
fav_id_data = fav_id.lstrip().split(":")
|
||||
if len(fav_id_data) > 10:
|
||||
data_id = ":".join(fav_id_data[:11])
|
||||
picon_id = "{}_{}_{}_{}_{}_{}_{}_{}_{}_{}.png".format(*fav_id_data[:10])
|
||||
locked = LOCKED_ICON if data_id in self._blacklist else None
|
||||
srv = Service(None, None, icon, srv.name, locked, None, None, s_type.name,
|
||||
self._picons.get(picon_id, None), picon_id, *agr, data_id, fav_id, None)
|
||||
self._services[fav_id] = srv
|
||||
elif srv.name:
|
||||
extra_services[fav_id] = srv.name
|
||||
|
||||
@@ -242,14 +242,14 @@ def set_lock(blacklist, services, model, paths, target, services_model):
|
||||
locked = has_locked_hide(model, paths, col_num)
|
||||
|
||||
ids = []
|
||||
skip_type = {BqServiceType.IPTV.name, BqServiceType.MARKER.name, BqServiceType.SPACE.name}
|
||||
skip_type = {BqServiceType.MARKER.name, BqServiceType.SPACE.name}
|
||||
|
||||
for path in paths:
|
||||
itr = model.get_iter(path)
|
||||
fav_id = model.get_value(itr, Column.SRV_FAV_ID if target is ViewTarget.SERVICES else Column.FAV_ID)
|
||||
srv = services.get(fav_id, None)
|
||||
if srv and srv.service_type not in skip_type:
|
||||
bq_id = to_bouquet_id(srv)
|
||||
bq_id = srv.data_id if srv.service_type == BqServiceType.IPTV.name else to_bouquet_id(srv)
|
||||
if not bq_id:
|
||||
continue
|
||||
blacklist.discard(bq_id) if locked else blacklist.add(bq_id)
|
||||
|
||||
Reference in New Issue
Block a user