mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +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,20 +81,15 @@ class ClientInfo():
|
|||
else:
|
||||
GUID_file = xbmc.translatePath(os.path.join(addon_path.encode("utf-8"), "machine_guid")).decode('utf-8')
|
||||
|
||||
try:
|
||||
GUID = xbmcvfs.File(GUID_file)
|
||||
|
||||
except Exception as e: # machine_guid does not exists.
|
||||
self.logMsg("Generating a new deviceid: %s" % e, 1)
|
||||
GUID = xbmcvfs.File(GUID_file)
|
||||
clientId = GUID.read()
|
||||
if not clientId:
|
||||
self.logMsg("Generating a new deviceid...", 1)
|
||||
clientId = str("%012X" % uuid4())
|
||||
GUID = xbmcvfs.File(GUID_file, 'w')
|
||||
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)
|
||||
utils.window('emby_deviceId', value=clientId)
|
||||
|
|
Loading…
Reference in a new issue