76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102 | # plugin attributes
module = "favicon"
meta = plugin_meta()
# Register with main
def __init__(self, parent):
# Reference main, and register station .play() hook
self.parent, self.main = parent, parent
parent.hooks["play"].append(self.update_playing)
# Register in channel/streams updating pipeline (to predefine row["favicon"] filename from `homepage` or `img`)
channels.GenericChannel.prepare_filters.append(self.prepare_filter_favicon)
# Prepare favicon cache directory
conf.icon_dir = conf.dir + "/icons"
if not os.path.exists(conf.icon_dir):
os.mkdir(conf.icon_dir)
open(icon_dir+"/.nobackup", "a").close()
# Main menu "Update favicons": update favicon cache for complete list
# of station rows. Just a wrapper now around update_rows(). Expects
# both entries=[] and channel={} argument still.
def update_all(self, *args, **kwargs):
self.parent.thread(self.update_rows, *args, **kwargs) |
|
>
>
>
>
>
>
<
<
<
<
<
| 76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103 | # plugin attributes
module = "favicon"
meta = plugin_meta()
# Register with main
def __init__(self, parent):
# Prepare favicon cache directory
conf.icon_dir = conf.dir + "/icons"
if not os.path.exists(conf.icon_dir):
os.mkdir(conf.icon_dir)
open(conf.icon_dir+"/.nobackup", "a").close()
# Reference main, and register station .play() hook
self.parent, self.main = parent, parent
parent.hooks["play"].append(self.update_playing)
# Register in channel/streams updating pipeline (to predefine row["favicon"] filename from `homepage` or `img`)
channels.GenericChannel.prepare_filters.append(self.prepare_filter_favicon)
# Main menu "Update favicons": update favicon cache for complete list
# of station rows. Just a wrapper now around update_rows(). Expects
# both entries=[] and channel={} argument still.
def update_all(self, *args, **kwargs):
self.parent.thread(self.update_rows, *args, **kwargs) |