Index: channels/radiotray.py ================================================================== --- channels/radiotray.py +++ channels/radiotray.py @@ -1,9 +1,9 @@ # api: streamtuner2 # title: RadioTray hook # description: Allows to bookmark stations to RadioTray/NG -# version: 0.6 +# version: 0.7 # type: feature # category: bookmarks # depends: deb:python-dbus, deb:streamtuner2, deb:python-xdg # config: # { name: radiotray_map, type: select, value: "group", select: 'root|group|asis|play', description: 'Map genres to default RadioTray groups, or just "root".' } @@ -132,16 +132,18 @@ # Radiotray-NG try: self.radiotray_ng().add_radio(row["title"], row["url"], group) except: - #try: - cfg = self.radiotray_ng().get_config() - self.save_rtng_json(cfg, row, group) - self.parent.status("Updated RT-NG bookmarks.json. Use Preferences>Reload Bookmarks..") - #except: - # log.ERR("radiotray-ng not active") + try: + cfg = self.radiotray_ng().get_config() + self.save_rtng_json(cfg, row, group) + #time.sleep(0.350) + self.radiotray_ng().reload_bookmarks() + self.parent.status("Exported to Radiotray. You may need to use Preferences > Reload Bookmarks.") + except Exception as e: + log.ERR("radiotray-ng not active", e) # RadioTray doesn't have an addRadio method yet, so just fall back to play the stream URL try: self.radiotray().addRadio(row["title"], row["url"], group) except: @@ -169,11 +171,11 @@ "stations": [] } j.append(found) # overwrite bookmarks.json if found: - g["stations"].append({ + found["stations"].append({ "image": None, "name": row["title"], "url": row["url"] }) json.dump(j, open(fn, "w"), indent=4)