Move id generator to utils

To be easily reused.
This commit is contained in:
angelblue05 2018-01-14 20:11:36 -06:00
parent 2575e3408f
commit 304aa503e1
2 changed files with 5 additions and 2 deletions

View file

@ -10,7 +10,7 @@ import xbmc
import xbmcaddon
import xbmcvfs
from utils import window, settings
from utils import window, settings, create_id
##################################################################################################
@ -85,7 +85,7 @@ class ClientInfo(object):
client_id = guid.read()
if not client_id:
log.info("Generating a new guid...")
client_id = str("%012X" % uuid4())
client_id = str("%012X" % create_id())
guid = xbmcvfs.File(emby_guid, 'w')
guid.write(client_id)

View file

@ -14,6 +14,7 @@ import urllib
import unicodedata
import xml.etree.ElementTree as etree
from datetime import datetime
from uuid import uuid4
import xbmc
@ -81,6 +82,8 @@ def dialog(type_, *args, **kwargs):
def urllib_path(plugin, params):
return "%s?%s" % (plugin, urllib.urlencode(params))
def create_id():
return uuid4()
class JSONRPC(object):