我正在尝试AutoResume
为KODI
. 现在addon
唯一保存当前播放歌曲的位置。重新启动后,它将播放该歌曲然后停止。但我希望它开始播放歌曲,然后播放之前播放的整个播放列表。
所以我试图改变代码,但我有一个问题。
我正在尝试像这样读取播放列表 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
我究竟做错了什么?