mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 02:06:09 +00:00
Fix deviceId not generating
Change the logic around xbmcvfs.File() since it doesn't causes an error but instead returns an empty string.
This commit is contained in:
parent
d3dfef4991
commit
c37a9efdf3
1 changed files with 5 additions and 10 deletions
|
@ -81,19 +81,14 @@ class ClientInfo():
|
||||||
else:
|
else:
|
||||||
GUID_file = xbmc.translatePath(os.path.join(addon_path.encode("utf-8"), "machine_guid")).decode('utf-8')
|
GUID_file = xbmc.translatePath(os.path.join(addon_path.encode("utf-8"), "machine_guid")).decode('utf-8')
|
||||||
|
|
||||||
try:
|
|
||||||
GUID = xbmcvfs.File(GUID_file)
|
GUID = xbmcvfs.File(GUID_file)
|
||||||
|
clientId = GUID.read()
|
||||||
except Exception as e: # machine_guid does not exists.
|
if not clientId:
|
||||||
self.logMsg("Generating a new deviceid: %s" % e, 1)
|
self.logMsg("Generating a new deviceid...", 1)
|
||||||
clientId = str("%012X" % uuid4())
|
clientId = str("%012X" % uuid4())
|
||||||
GUID = xbmcvfs.File(GUID_file, 'w')
|
GUID = xbmcvfs.File(GUID_file, 'w')
|
||||||
GUID.write(clientId)
|
GUID.write(clientId)
|
||||||
|
|
||||||
else: # machine_guid already exists. Get guid.
|
|
||||||
clientId = GUID.read()
|
|
||||||
|
|
||||||
finally:
|
|
||||||
GUID.close()
|
GUID.close()
|
||||||
|
|
||||||
self.logMsg("DeviceId loaded: %s" % clientId, 1)
|
self.logMsg("DeviceId loaded: %s" % clientId, 1)
|
||||||
|
|
Loading…
Reference in a new issue