Skip to content

Commit

Permalink
v.0.1.1 - minor bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kuzin2006 committed Feb 10, 2017
1 parent 0830332 commit 7686551
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
6 changes: 3 additions & 3 deletions addon.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.audio.radio.roks" name="Radio Roks online" version="0.1.0" provider-name="Eugene Kuzin">
<addon id="plugin.audio.radio.roks" name="Radio Roks online" version="0.1.1" provider-name="Eugene Kuzin">
<requires>
<import addon="xbmc.python" version="2.20.0" />
<import addon="xbmc.python" version="2.24.0" />
</requires>
<extension point="xbmc.python.pluginsource" library="radioroks.py">
<provides>audio</provides>
Expand Down Expand Up @@ -30,6 +30,6 @@
<screenshot>resources/screenshot-03.jpg</screenshot>
<screenshot>resources/screenshot-04.jpg</screenshot-->
</assets>
<news>v0.1.0 (2017-02-08) - first release</news>
<news>v0.1.1 (2017-02-10) - minor bugfixes</news>
</extension>
</addon>
14 changes: 9 additions & 5 deletions radioroks.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# You should have received a copy of the GNU General Public License
# along with this plugin. If not, see <http://www.gnu.org/licenses/>.

import os
import sys
import urllib
import urlparse
Expand All @@ -29,7 +30,8 @@
import xml.etree.ElementTree as ET
import random

VERSION = '0.1.0'
VERSION = '0.1.1'


def build_url(query):
base_url = sys.argv[0]
Expand All @@ -47,7 +49,8 @@ def play_song(url, icon):
# build playlist
def parse_channels():
play_list = []
tree = ET.parse(addon_path + '/resources/data/channels.xml')
channels_path = os.path.join(addon_path, 'resources', 'data', 'channels.xml')
tree = ET.parse(channels_path)
channels = tree.getroot()
for channel in channels.findall('channel'):
# check minimum required channel data
Expand All @@ -70,7 +73,7 @@ def parse_channels():
if icon is None:
icon = 'DefaultMusicCompilations.png'
else:
icon = addon_path + '/resources/media/' + channel.find('icon').text
icon = os.path.join(addon_path, 'resources', 'media', channel.find('icon').text)
# now add ListItem
li = xbmcgui.ListItem(label=name)
li.setArt({'icon': icon,
Expand All @@ -79,9 +82,10 @@ def parse_channels():
fanarts = channel.findall('fanart')
if len(fanarts) > 0:
fanart_file = fanarts[random.randint(0, len(fanarts)-1)].text
li.setArt({'fanart': addon_path + '/resources/media/' + fanart_file})
fanart_path = os.path.join(addon_path, 'resources', 'media', fanart_file)
else:
li.setArt({'fanart': addon_path + '/fanart.jpg'})
fanart_path = os.path.join(addon_path, 'fanart.jpg')
li.setArt({'fanart': fanart_path})
# set Info
li.setInfo('music', {'genre': 'Rock', 'artist': name, 'title': 'Online Stream'})
# set the list item to playable
Expand Down

0 comments on commit 7686551

Please sign in to comment.