我试图国防部AutoResume
插件的KODI
。现在addon
只保存当前播放的歌曲位置。重新启动后,它将播放该歌曲,然后停止播放。 但我希望它开始播放歌曲,然后播放整个播放列表,这是以前播放的。KODI - getPlayListId()缺少参数
所以我试图改变代码,但我有一个问题。
我想读播放列表ID是这样的:
mediaFile = xbmc.Player().getPlayingFile()
position = xbmc.Player().getTime()
# The line in question:
playList = xbmc.PlayList().getPlayListId()
# Write info to file
f = open('/home/pi/autoresume.txt', 'w')
f.write(mediaFile)
f.write('\n')
f.write(repr(position))
f.write('\n')
f.write(repr(playList))
f.close()
但是Python给了我这样的:
-->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.TypeError'>
Error Contents: function takes exactly 1 argument (0 given)
Traceback (most recent call last):
File "/home/pi/.kodi/addons/service.autoResume-master/default.py", line 79, in <module>
recordPosition()
File "/home/pi/.kodi/addons/service.autoResume-master/default.py", line 59, in recordPosition
playList = xbmc.PlayList().getPlayListId()
TypeError: function takes exactly 1 argument (0 given)
-->End of Python script error report<--
如果我没有理解这getPlaylistId()正确地存在缺失的说法,但这方法不需要参数: http://mirrors.xbmc.org/docs/python-docs/stable/xbmc.html#PlayList-getPlayListId
我在做什么错?
你能尝试使用'帮助()'内置在shell此功能,看看它说什么? – vmonteco
对不起,你是怎么做到的? – Kamion
尝试'import xbmc'然后'help(xbmc.PlayList()。getPlayListId)'。 – vmonteco