Skip to content

Commit

Permalink
Thumbnail images to history
Browse files Browse the repository at this point in the history
  • Loading branch information
vidarw committed May 1, 2014
1 parent 41cead2 commit b11a9ef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* Fixed/improved feature
- Removed feature

2014-05-04 v1.0.2
2014-05-01 v1.0.2
=================

+ Added thumbnail image to streams to improve experience in favorites menu.
+ Added thumbnail to elements to improve experience in favorites and plugin.
Thanks to robho (https://github.com/robho)

2014-04-23 v1.0.1
Expand Down
16 changes: 8 additions & 8 deletions default.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ def __init__(self):
xbmcplugin.setContent(HANDLE, 'audio')

self.curl = HTTPComm()

self.name = ARGS.get('foldername', None)
self.mode = ARGS.get('mode', None)
self.thumbnailImage = 'special://home/addons/%s/icon.png' % ADDON_ID


def run(self):

Expand All @@ -73,10 +74,9 @@ def run(self):

elif self.mode[0] == 'folder' and self.name[0] == 'streams':

thumbnailImage = 'special://home/addons/%s/icon.png' % ADDON_ID
streams = self.get_streams()
for stream in streams:
li = xbmcgui.ListItem(stream['name'], iconImage='DefaultAudio.png', thumbnailImage=thumbnailImage)
li = xbmcgui.ListItem(stream['name'], iconImage='DefaultAudio.png', thumbnailImage=self.thumbnailImage)
li.setInfo(type="Music", infoLabels={"Size": stream['bitrate'] * 1024})
li.setProperty("IsPlayable", "true")
xbmcplugin.addDirectoryItem(handle=HANDLE, url=stream['url'], listitem=li, isFolder=False)
Expand All @@ -90,23 +90,23 @@ def run(self):
# Currently Playing
self.add_heading(ADDON.getLocalizedString(30200))
for item in history[0]:
li = xbmcgui.ListItem(item["artist"] + " - " + item["song"])
li = xbmcgui.ListItem(item["artist"] + " - " + item["song"], thumbnailImage=self.thumbnailImage)
li.setProperty("IsPlayable", "false")
xbmcplugin.addDirectoryItem(handle=HANDLE, url="nnn", listitem=li, isFolder=False)


# Queue
self.add_heading(ADDON.getLocalizedString(30201), True)
for item in history[1]:
li = xbmcgui.ListItem(item["artist"] + " - " + item["song"])
li = xbmcgui.ListItem(item["artist"] + " - " + item["song"], thumbnailImage=self.thumbnailImage)
li.setProperty("IsPlayable", "false")
xbmcplugin.addDirectoryItem(handle=HANDLE, url="nnn", listitem=li, isFolder=False)


# History
self.add_heading(ADDON.getLocalizedString(30202), True)
for item in history[2]:
li = xbmcgui.ListItem(item["artist"] + " - " + item["song"])
li = xbmcgui.ListItem(item["artist"] + " - " + item["song"], thumbnailImage=self.thumbnailImage)
li.setProperty("IsPlayable", "false")
xbmcplugin.addDirectoryItem(handle=HANDLE, url="nnn", listitem=li, isFolder=False)

Expand Down Expand Up @@ -180,11 +180,11 @@ def get_history(self):
def add_heading(self, title, linebreak=False):
# Linebreak
if linebreak:
li = xbmcgui.ListItem()
li = xbmcgui.ListItem(thumbnailImage=self.thumbnailImage)
li.setProperty("IsPlayable", "false")
xbmcplugin.addDirectoryItem(handle=HANDLE, url="nnn", listitem=li, isFolder=False)

li = xbmcgui.ListItem(label="[COLOR FF007EFF]" + title + "[/COLOR]")
li = xbmcgui.ListItem(label="[COLOR FF007EFF]" + title + "[/COLOR]", thumbnailImage=self.thumbnailImage)
li.setProperty("IsPlayable", "false")
xbmcplugin.addDirectoryItem(handle=HANDLE, url="nnn", listitem=li, isFolder=False)

Expand Down

0 comments on commit b11a9ef

Please sign in to comment.