我試圖國防部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