mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
Move id generator to utils
To be easily reused.
This commit is contained in:
parent
2575e3408f
commit
304aa503e1
2 changed files with 5 additions and 2 deletions
|
@ -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)
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
||||
|
|
Loading…
Reference in a new issue