From e56f0c5c82eaf1c989caa6269ef301aad6b184b7 Mon Sep 17 00:00:00 2001 From: KOL Date: Sat, 13 Dec 2014 20:49:52 +0300 Subject: [PATCH] - Fix LG play video with long description - Video info now fetching from API instead of parsing from callback data --- Contents/Code/__init__.py | 19 ++++++++++++++++--- Contents/Info.plist | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Contents/Code/__init__.py b/Contents/Code/__init__.py index 03fb1fe..911e7bc 100644 --- a/Contents/Code/__init__.py +++ b/Contents/Code/__init__.py @@ -167,9 +167,21 @@ def VideoList(uid, title, album_id=0, offset=0): @route(PREFIX_V + '/play') -def VideoPlay(info): +def VideoPlay(uid, vid): - item = JSON.ObjectFromString(info) + res = ApiRequest('video.get', { + 'owner_id': uid, + 'videos': '%s_%s' % (uid, vid), + 'width': 320, + }) + + if not res or not res['count']: + return ObjectContainer( + header=L('Error'), + message=L('No entries found') + ) + + item = res['items'][0] if not item: raise Ex.MediaNotAvailable @@ -246,7 +258,8 @@ def GetVideoObject(item): return VideoClipObject( key=Callback( VideoPlay, - info=JSON.StringFromObject(item) + uid=item['owner_id'], + vid=item['id'] ), rating_key='%s.%s' % (Plugin.Identifier, item['id']), title=u'%s' % item['title'], diff --git a/Contents/Info.plist b/Contents/Info.plist index 79fedec..ff33098 100644 --- a/Contents/Info.plist +++ b/Contents/Info.plist @@ -14,7 +14,7 @@ CFBundleSignature hook CFBundleVersion - 1.2 + 1.3 PlexClientPlatforms *