18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
18
19
20
21
22
23
24
25
26
27
28
29
|
-
+
-
-
-
-
|
import copy
# hooks into main.bookmarks
class links (object):
class links (FeaturePlugin):
# plugin info
module = 'links'
meta = plugin_meta()
# list
streams = [ ]
default = [
("stream", "rad.io", "http://www.rad.io/"),
("stream", "RadioTower", "http://www.radiotower.com/"),
|
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
-
+
-
-
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
|
]
# prepare gui
def __init__(self, parent):
def init2(self, parent):
if parent:
if not parent:
return
# prepare target category
bookmarks = parent.bookmarks
if not bookmarks.streams.get(self.module):
bookmarks.streams[self.module] = []
bookmarks.add_category(self.module)
# fill it up later
parent.hooks["init"].append(self.populate)
# prepare target category
bookmarks = parent.bookmarks
if not bookmarks.streams.get(self.module):
bookmarks.streams[self.module] = []
bookmarks.add_category(self.module)
# fill it up later
parent.hooks["init"].append(self.populate)
def populate(self, parent):
# Collect links from channel plugins
for name,channel in parent.channels.items():
try:
self.streams.append({
"favourite": 1,
"genre": "channel",
"title": channel.meta.get("title", channel.module),
"homepage": channel.meta.get("url", ""),
"type": "text/html",
"format": "text/html",
})
except Exception as e:
log.ERR("links: adding entry failed:", e)
# Add built-in link list
|