2014-03-26, 15:43
artistid and albumartistid are not retrieve with GetDirectory method and Songs or Albums smart playlists.
Playlist:
Result :
Playlist:
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="songs">
<name>Last Played Songs</name>
<match>all</match>
<rule field="lastplayed" operator="inthelast">
<value>3 weeks</value>
</rule>
<order direction="ascending">lastplayed</order>
</smartplaylist>
Code:
_json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"directory": "%s", "media": "music", "properties": ["artistid", "albumid", "albumartistid", "dateadded"]}, "id": 1}' %(PLAYLIST))
_json_query = unicode(_json_query, 'utf-8', errors='ignore')
_json_pl_response = json.loads(_json_query)
_files = _json_pl_response.get( "result", {} ).get( "files" )
print("_files=",_files)
Result :
Code:
('_files=', [{u'filetype': u'file', u'label': u'Do I Wanna Know?', u'albumid': 2, u'file': u'G:\\Musiques\\Arctic Monkeys\\2013 - AM\\01 - Arctic Monkeys - Do I Wanna Know-.mp3', u'type': u'song', u'id': 2360}, {u'filetype': u'file', u'label': u'Rolling into deep', u'albumid': 1, u'file': u'G:\\Musiques\\Adele\\2011 - 21\\01 Rolling in the Deep.mp3', u'type': u'song', u'id': 2347}])