Index: channels/__init__.py ================================================================== --- channels/__init__.py +++ channels/__init__.py @@ -115,11 +115,11 @@ self.meta = plugin_meta(src = inspect.getcomments(inspect.getmodule(self))) self.config = self.meta.get("config", []) self.title = self.meta.get("title", self.module) # add default options values to config.conf.* dict - conf.add_plugin_defaults(self.meta["config"], self.module) + conf.add_plugin_defaults(self.meta, self.module) # only if streamtuner2 is run in graphical mode if (parent): self.cache() self.gui(parent) Index: config.py ================================================================== --- config.py +++ config.py @@ -122,21 +122,21 @@ self.pyquery = 1 self.debug = 0 # each plugin has a .config dict list, we add defaults here - def add_plugin_defaults(self, config, module=""): + def add_plugin_defaults(self, meta, module=""): # options + config = meta.get("config", []) for opt in config: if ("name" in opt) and ("value" in opt) and (opt["name"] not in vars(self)): self.__dict__[opt["name"]] = opt["value"] # plugin state if module and module not in conf.plugins: - conf.plugins[module] = 1 - #@TODO: use meta["priority"] in ("core", "builtin", "default") etc. + conf.plugins[module] = meta.get("priority") in ("core", "builtin", "default", "standard") # http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html def xdg(self, path="/streamtuner2"): Index: st2.py ================================================================== --- st2.py +++ st2.py @@ -293,18 +293,20 @@ row = self.row() self.action.record(row.get("url"), row.get("format", "audio/mpeg"), "url/direct", row=row) # Open stream homepage in web browser def on_homepage_stream_clicked(self, widget): - url = self.selected("homepage") - self.action.browser(url) + url = self.selected("homepage") + if url and len(url): self.action.browser(url) + else: self.status("No homepage URL present.") # Browse to channel homepage (double click on notebook tab) def on_homepage_channel_clicked(self, widget, event=2): if event == 2 or event.type == gtk.gdk._2BUTTON_PRESS: __print__(dbg.UI, "dblclick") - self.action.browser(self.channel().homepage) + url = self.channel().meta.get("url", "https://duckduckgo.com/?q=" + self.channel().module) + self.action.browser(self.channel().url) # Reload stream list in current channel-category def on_reload_clicked(self, widget=None, reload=1): __print__(dbg.UI, "reload", reload, self.current_channel, self.channels[self.current_channel], self.channel().current) category = self.channel().current