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() に引数がありませんが、このメソッドにはパラメーターは必要ありません 。
私は何を間違っていますか?