137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155 | 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) |
|
|
>
| 137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156 | 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) |
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211 | 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", |
<
<
| 197
198
199
200
201
202
203
204
205
206
207
208
209
210 | 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", |