Skip to content

Commit

Permalink
Favourites fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonardo Cervo committed May 23, 2016
1 parent b352ea5 commit 4e06e61
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion GoogleMusicActions.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def addFavourite(self, name, params):
url = url+'&'+unicode(k)+'='+unicode(v)

fav = '\t<favourite name="%s" thumb="%s">ActivateWindow(10501,&quot;%s?%s&quot;,return)</favourite>'
fav = fav % (name, xbmc.translatePath(self.icon), utils.addon_url , url[1:])
fav = fav % (name, xbmc.translatePath(self.icon), utils.addon_url , url[5:])

if not os.path.isfile(path):
with open(path, "w") as favfile:
Expand All @@ -167,6 +167,9 @@ def addFavourite(self, name, params):
favfile.write("</favourites>")
else:
for line in fileinput.input(path, inplace=1):
if line.startswith('<favourites />'):
print "<favourites>\n"+fav+"\n</favourites>"
continue
if line.startswith('</favourites>'):
print fav
print line,
Expand Down

0 comments on commit 4e06e61

Please sign in to comment.