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

⌈⌋ branch:  streamtuner2


Check-in [004dcfb202]

Overview
Comment:Fix "play" setting detection / remove NotImplementedErr
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:004dcfb202fba40b031205e7177df4f678f104a3
User & Date: mario on 2019-01-01 04:58:18
Other Links: manifest | tags
Context
2019-01-01
05:52
Remove 0install support. check-in: a89faaac39 user: mario tags: trunk
04:58
Fix "play" setting detection / remove NotImplementedErr check-in: 004dcfb202 user: mario tags: trunk
2018-12-31
19:44
2.2.1 check-in: a9da736771 user: mario tags: trunk
Changes

Modified channels/radiotray.py from [1d0d5fe309] to [381392f6f0].

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

149
150
151
152
153
154
155
...
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
        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)
            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:
                    log.ERR("radiotray-ng not active", e)
................................................................................
    def map_group(self, genre):
        if not genre or not len(genre) or conf.radiotray_map == "root":
            return "root"
        if conf.radiotray_map == "channel":
            return "%s - %s" % (self.parent.current_channel, self.parent.channel().current)
        if conf.radiotray_map == "asis":
            return genre  # if RadioTray itself can map arbitrary genres to its folders
        if conf.radiotray_map == "play":
            raise NotImplementedError("just call .playUrl()")
        if conf.radiotray_map == "category":
            genre = self.parent.channel().current
        # else "group" - find first fit for station genre
        map = {
            "Jazz": "jazz|fusion|swing",
            "Latin": "latin|flamenco|tango|salsa|samba",
            "Classic Rock": "classic rock",







|



|
>







 







<
<







137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
...
197
198
199
200
201
202
203


204
205
206
207
208
209
210
        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.radiotray_map == "play":
                    self.radiotray_ng().play_url(row["url"])
                else:
                    self.radiotray_ng().add_radio(row["title"], row["url"], group)
            except Exception, e:
                log.ERR("RTNG DBUS error", e)
                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:
                    log.ERR("radiotray-ng not active", e)
................................................................................
    def map_group(self, genre):
        if not genre or not len(genre) or conf.radiotray_map == "root":
            return "root"
        if conf.radiotray_map == "channel":
            return "%s - %s" % (self.parent.current_channel, self.parent.channel().current)
        if conf.radiotray_map == "asis":
            return genre  # if RadioTray itself can map arbitrary genres to its folders


        if conf.radiotray_map == "category":
            genre = self.parent.channel().current
        # else "group" - find first fit for station genre
        map = {
            "Jazz": "jazz|fusion|swing",
            "Latin": "latin|flamenco|tango|salsa|samba",
            "Classic Rock": "classic rock",