Internet radio browser GUI for music/video streams from various directory services.

⌈⌋ ⎇ branch:  streamtuner2


Check-in [6bbc8bba7f]

Overview
Comment:Add .reload_bookmarks for RT-NG
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6bbc8bba7fc2b5ed99b51ca51dffb015241c08e9
User & Date: mario on 2018-12-17 20:32:38
Other Links: manifest | tags
Context
2018-12-17
22:19
Added crude support for binding internal calls `object.func()` to buttons. check-in: bbb93d412c user: mario tags: trunk
20:32
Add .reload_bookmarks for RT-NG check-in: 6bbc8bba7f user: mario tags: trunk
16:50
shoutcast: reenable referer sending check-in: e5e2175cfc user: mario tags: trunk
Changes

Modified channels/radiotray.py from [5e56c67925] to [f78abe4734].

1
2
3
4
5
6
7
8
9
10
11
# api: streamtuner2
# title: RadioTray hook
# description: Allows to bookmark stations to RadioTray/NG
# version: 0.6
# 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".' }
# url: http://radiotray.sourceforge.net/
# priority: extra



|







1
2
3
4
5
6
7
8
9
10
11
# api: streamtuner2
# title: RadioTray hook
# description: Allows to bookmark stations to RadioTray/NG
# 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".' }
# url: http://radiotray.sourceforge.net/
# priority: extra
130
131
132
133
134
135
136
137
138
139


140
141
142
143
144
145
146
147
148
149
            group = self.map_group(row.get("genre"))
            log.PROC("mapping genre '%s' to RT group '%s'" % (row["genre"], group))

            # 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")

            # 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:
                try:
                    self.radiotray().playUrl(row["url"])







|


>
>
|
|
|







130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
            group = self.map_group(row.get("genre"))
            log.PROC("mapping genre '%s' to RT group '%s'" % (row["genre"], group))

            # 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)
                    #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:
                try:
                    self.radiotray().playUrl(row["url"])
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
                "group": row["genre"],
                "image": None,
                "stations": []
            }
            j.append(found)
        # overwrite bookmarks.json
        if found:
            g["stations"].append({
                "image": None,
                "name": row["title"],
                "url": row["url"]
            })
            json.dump(j, open(fn, "w"), indent=4)

    # match genre to RT groups







|







169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
                "group": row["genre"],
                "image": None,
                "stations": []
            }
            j.append(found)
        # overwrite bookmarks.json
        if found:
            found["stations"].append({
                "image": None,
                "name": row["title"],
                "url": row["url"]
            })
            json.dump(j, open(fn, "w"), indent=4)

    # match genre to RT groups