Index: channels/__init__.py ================================================================== --- channels/__init__.py +++ channels/__init__.py @@ -602,10 +602,12 @@ # playlist and audio type audioformat = row.get("format", self.audioformat) listformat = row.get("listformat", self.listformat) # invoke audio player action.play(row, audioformat, listformat) + elif row.get("homepage") and row.get("format") == "text/html": + action.browser(row["homepage"]) else: self.status("No station selected for playing.") return row # Start streamripper/youtube-dl/etc Index: channels/links.py ================================================================== --- channels/links.py +++ channels/links.py @@ -1,11 +1,11 @@ # api: streamtuner2 # title: Links to directory services # description: Static list of various music directory websites. # type: group # category: web -# version: 0.2 +# version: 0.3 # priority: standard # config: - # # Simply adds a "links" entry in bookmarks tab, where known services # are listed with homepage links. Registered plugins automatically @@ -18,16 +18,12 @@ 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,22 +57,22 @@ ] # prepare gui - def __init__(self, parent): - - if parent: - - # 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 init2(self, 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) def populate(self, parent): # Collect links from channel plugins @@ -85,11 +81,11 @@ 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