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

⌈⌋ branch:  streamtuner2


Diff

Differences From Artifact [d06646c6dc]:

To Artifact [1d0d5fe309]:


1
2
3
4
5

6
7
8
9
10
11
12
1
2
3
4

5
6
7
8
9
10
11
12




-
+






# encoding: utf-8
# api: streamtuner2
# title: RadioTray hook
# description: Allows to bookmark stations to RadioTray/NG
# version: 0.8
# version: 0.9
# type: feature
# category: bookmarks
# depends: deb:python-dbus, deb:streamtuner2, deb:python-xdg
# config:
#   { name: radiotray_map, type: select, value: "group", select: 'root|group|category|asis|channel|play', description: 'Map genres to default RadioTray groups, or just "root".' }
# url: http://radiotray.sourceforge.net/
# priority: extra
22
23
24
25
26
27
28
29

30
31
32
33
34
35
36
22
23
24
25
26
27
28

29
30
31
32
33
34
35
36







-
+






#
# The mapping options:
#   · "root" is just meant for the old Radiotray format.
#   · "group" tries to fit genres onto existing submenus.
#   · "category" maps just the channel category.
#   · "channel" instead creates `Shoutcast - Rock` entries.
#   · "asis" will transfer the literal station genre.
#   · "play" is unused.
#   · "play" for RT-NG to stream instantly (no bookmarking).
#
# With the old Radiotry this plugin will fall back to just
# playUrl() until the addRadio remote call is added.
# The patch for radiotray/DbusFacade.py would be:
#   +
#   +    @dbus.service.method('net.sourceforge.radiotray')
#   +    def addRadio(self, title, url, group="root"):
137
138
139
140
141
142
143



144

145
146
147
148
149
150
151
137
138
139
140
141
142
143
144
145
146

147
148
149
150
151
152
153
154







+
+
+
-
+






        row = self.parent.row()
        if row:
            group = self.map_group(row.get("genre", self.parent.channel().current))
            log.PROC("mapping genre '%s' to RT group '%s'" % (row["genre"], group))

            # Radiotray-NG
            try:
                if conf.radiotry_map == "play":
                    self.radiotray_ng().play_url(row["url"])
                else:
                self.radiotray_ng().add_radio(row["title"], row["url"], group)
                    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.radiotray_ng().reload_bookmarks()
                    self.parent.status("Exported to Radiotray. You may need to use Preferences > Reload Bookmarks.")
                except Exception as e: