Skip to content

Commit

Permalink
Fix sorting All videos and all music (was broken by API vk.com)
Browse files Browse the repository at this point in the history
  • Loading branch information
KOL committed Dec 30, 2014
1 parent df240d9 commit ebabd0d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
23 changes: 15 additions & 8 deletions Contents/Code/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,17 @@ def VideoAlbums(uid, title, offset=0):


@route(PREFIX_V + '/list')
def VideoList(uid, title, album_id=0, offset=0):
res = ApiRequest('video.get', {
def VideoList(uid, title, album_id=None, offset=0):
params = {
'owner_id': uid,
'album_id': album_id,
'width': 320,
'count': Prefs['video_per_page'],
'offset': offset
})
}
if album_id is not None:
params['album_id'] = album_id

res = ApiRequest('video.get', params)

if not res or not res['count']:
return NoContents()
Expand Down Expand Up @@ -332,13 +335,17 @@ def MusicAlbums(uid, title, offset=0):


@route(PREFIX_M + '/list')
def MusicList(uid, title, album_id=0, offset=0):
res = ApiRequest('audio.get', {
def MusicList(uid, title, album_id=None, offset=0):

params = {
'owner_id': uid,
'album_id': album_id,
'count': Prefs['audio_per_page'],
'offset': offset
})
}
if album_id is not None:
params['album_id'] = album_id

res = ApiRequest('audio.get', params)

if not res or not res['count']:
return NoContents()
Expand Down
2 changes: 1 addition & 1 deletion Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<key>CFBundleSignature</key>
<string>hook</string>
<key>CFBundleVersion</key>
<string>2.2</string>
<string>2.3</string>

<key>PlexClientPlatforms</key>
<string>*</string>
Expand Down

0 comments on commit ebabd0d

Please sign in to comment.