diff options
author | Eike <derbaranator@gmail.com> | 2017-07-23 19:38:33 +0200 |
---|---|---|
committer | enen92 <enen92@users.noreply.github.com> | 2017-07-23 18:38:33 +0100 |
commit | 8acae2506546a24127a3b868f381f26df1d8df95 (patch) | |
tree | 39b0d1a06d0312269df483fe748dc4653c3c25ba /plugin.audio.hearthis_at/addon.py | |
parent | 8cf29cb3c3074f63b70efb8c3523a68ae2e589b5 (diff) |
[plugin.audio.hearthis_at] 1.0.2 (#1336)
Diffstat (limited to 'plugin.audio.hearthis_at/addon.py')
-rw-r--r--[-rwxr-xr-x] | plugin.audio.hearthis_at/addon.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/plugin.audio.hearthis_at/addon.py b/plugin.audio.hearthis_at/addon.py index 2f1c6fe..daf66f7 100755..100644 --- a/plugin.audio.hearthis_at/addon.py +++ b/plugin.audio.hearthis_at/addon.py @@ -41,7 +41,7 @@ STRINGS = { 'reshared' : 30019, 'add_reshared' : 30020, 'rm_reshared' : 30021, - 'login_failed' : 30055 + 'login_failed' : 30022 } @@ -127,11 +127,11 @@ def list_tracks(tracklist, pagination = None, first=False, pre=[], post=[]): 'genre': t.get('genre', None), 'playcount': int(t.get('playback_count', None)) }, - 'context_menu': [ - show_user_context_item(t['user']['permalink']), - context_item_toggle('like', t['favorited'], {'user':t['user']['permalink'], 'trackid': t['permalink']}), + 'context_menu': + show_user_context_item(t['user']['permalink']) + + context_item_toggle('like', t['favorited'], {'user':t['user']['permalink'], 'trackid': t['permalink']}) + context_item_toggle('reshared', t['reshared'], {'user':t['user']['permalink'], 'trackid': t['permalink']}) - ], + , 'path': plugin.url_for('play_track', trackid=t['permalink'], user=t['user']['permalink']), 'is_playable': True }) @@ -190,7 +190,7 @@ def login(): def logged_in(): - return USER['data'] != None + return USER.get('data', None) != None def context_item_toggle(prop, state, parms): @@ -200,15 +200,15 @@ def context_item_toggle(prop, state, parms): else: lbl = 'add_'+prop parms['prop'] = prop - ar_follow = ( _(lbl), actions.update_view(plugin.url_for('toggle_prop', **parms))) + ar_follow = [( _(lbl), actions.update_view(plugin.url_for('toggle_prop', **parms)))] else: - ar_follow = None + ar_follow = [] return ar_follow def show_user_context_item(user): show_user_url = plugin.url_for('show_user_first', user=user, page=1, first='True') - return ( _('show_artist'), actions.update_view(show_user_url)) + return [ ( _('show_artist'), actions.update_view(show_user_url)) ] @plugin.route('/') |