2017-03-07, 00:56
@Milhouse, I have a python script which calls texturecache.py for scanning a new movie path.
This used to work but now i don't get the response I used to get:
I only get the response:
Can you implement a valid response from json rpc response?
Thanks
This used to work but now i don't get the response I used to get:
Code:
def update_kodi(self, group):
log.info("Sending JSON-RPC update command to Kodi")
try:
remote_moviepath = os.path.join(self.prefix_path, os.path.basename(os.path.normpath(group['destination_dir'])))
log.debug("Sending JSON VideoLibrary.Scan to scan new movie: %s", remote_moviepath)
command = []
command = ['python', self.texturecache_path, 'vscan', self.prefix_path, self.config_file, self.log_file]
p = Popen(command, stdout=PIPE, stderr=STDOUT)
response = p.communicate()[0]
response = response[:-1] if response.endswith("\n") else response
log.debug('update_kodi response: %s', response)
if response.find('Updating Library: New movieid') != -1:
log.info("Successfully updated Kodi library with movie: %s", self.movie_name)
# wait for Kodi to update database
time.sleep(20)
return True
else:
log.info("No response from Kodi! Disconnected?")
return False
except:
log.error("There was a problem updating Kodi library with movie %s: %s", (self.movie_name, (traceback.format_exc())))
return False
I only get the response:
Code:
update_kodi response: Rescanning directory: nfs://192.168.1.77/movies/...
Can you implement a valid response from json rpc response?
Thanks