Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions script.radioparadise/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v2.2.0

- Add Beyond channel

## v2.1.2

- Add Serenity to Auto Play options
Expand Down
3 changes: 2 additions & 1 deletion script.radioparadise/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ RunScript('script.radioparadise', 1)
| 1 | Mellow Mix |
| 2 | Rock Mix |
| 3 | Global Mix |
| 4 | Serenity |
| 5 | Beyond... |
| 42 | Serenity |

This can be used to add shortcuts for RP channels in [favourites.xml][].

Expand Down
2 changes: 1 addition & 1 deletion script.radioparadise/addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.radioparadise" name="Radio Paradise" version="2.1.2" provider-name="Alexander Dietrich">
<addon id="script.radioparadise" name="Radio Paradise" version="2.2.0" provider-name="Alexander Dietrich">
<requires>
<import addon="xbmc.python" version="3.0.1"/>
<import addon="script.module.requests" version="2.0.0"/>
Expand Down
16 changes: 11 additions & 5 deletions script.radioparadise/resources/channels.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,36 @@
[
{
"channel_id": "0",
"channel_id": 0,
"title": "Main Mix",
"url_aac": "http://stream.radioparadise.com/aac-128",
"url_flac": "http://stream.radioparadise.com/flacm"
},
{
"channel_id": "1",
"channel_id": 1,
"title": "Mellow Mix",
"url_aac": "http://stream.radioparadise.com/mellow-128",
"url_flac": "http://stream.radioparadise.com/mellow-flacm"
},
{
"channel_id": "2",
"channel_id": 2,
"title": "Rock Mix",
"url_aac": "http://stream.radioparadise.com/rock-128",
"url_flac": "http://stream.radioparadise.com/rock-flacm"
},
{
"channel_id": "3",
"channel_id": 3,
"title": "Global Mix",
"url_aac": "http://stream.radioparadise.com/global-128",
"url_flac": "http://stream.radioparadise.com/global-flacm"
},
{
"channel_id": "42",
"channel_id": 5,
"title": "Beyond...",
"url_aac": "http://stream.radioparadise.com/beyond-128",
"url_flac": "http://stream.radioparadise.com/beyond-flacm"
},
{
"channel_id": 42,
"title": "Serenity",
"url_aac": "http://stream.radioparadise.com/serenity",
"url_flac": "http://stream.radioparadise.com/serenity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@ msgstr ""
msgctxt "#30208"
msgid "Serenity"
msgstr ""

msgctxt "#30209"
msgid "Beyond..."
msgstr ""
15 changes: 9 additions & 6 deletions script.radioparadise/resources/lib/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class Window(xbmcgui.WindowXML):
def onInit(self):
xbmc.executebuiltin('Container.SetViewMode(100)')
listitems = []
for idx, channel in enumerate(CHANNELS):
for channel in CHANNELS:
item = xbmcgui.ListItem(channel['title'])
item.setProperty('channel_index', str(idx))
item.setProperty('channel_id', str(channel['channel_id']))
listitems.append(item)
self.clearList()
self.addItems(listitems)
Expand All @@ -23,14 +23,17 @@ def onInit(self):
def onClick(self, controlId):
if controlId == 100:
item = self.getListItem(self.getCurrentListPosition())
channel_index = int(item.getProperty('channel_index'))
play_channel(channel_index)
channel_id = int(item.getProperty('channel_id'))
play_channel(channel_id)
self.close()


def play_channel(channel_index):
def play_channel(channel_id):
"""Play the channel, unless it's already playing."""
channel = CHANNELS[channel_index]
channel = {c['channel_id']: c for c in CHANNELS}.get(channel_id)
if channel is None:
return

addon = xbmcaddon.Addon()
audio_format = addon.getSetting('audio_format')
if audio_format == 'flac':
Expand Down
3 changes: 2 additions & 1 deletion script.radioparadise/resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
<option label="30204">1</option>
<option label="30205">2</option>
<option label="30206">3</option>
<option label="30208">4</option>
<option label="30209">5</option>
<option label="30208">42</option>
</options>
</constraints>
<control type="spinner" format="string"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
<control type="image">
<right>50%</right>
<centertop>50%</centertop>
<width>300</width>
<height>300</height>
<width>400</width>
<height>400</height>
<aspectratio>keep</aspectratio>
<bordersize>10</bordersize>
<texture>logo.png</texture>
</control>
<control type="list" id="100">
<left>50%</left>
<centertop>50%</centertop>
<width>150</width>
<height>150</height>
<width>140</width>
<height>180</height>
<viewtype>list</viewtype>
<itemlayout height="30">
<control type="label">
Expand Down
Binary file modified script.radioparadise/resources/skins/Default/media/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.