Fix X-Plex-Client-Identifier to send unique id per client, not static value.

This commit is contained in:
Tim 2015-06-28 14:28:26 +02:00
commit 4f1056cf87
4 changed files with 14 additions and 2 deletions

View file

@ -24,6 +24,7 @@ import webbrowser
import sqlite3
import cherrypy
import datetime
import uuid
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.triggers.interval import IntervalTrigger
@ -128,6 +129,12 @@ def initialize(config_file):
except Exception as e:
logger.error("Can't connect to the database: %s", e)
# Check if PlexPy has a uuid
if CONFIG.PMS_UUID == '' or not CONFIG.PMS_UUID:
my_uuid = generate_uuid()
CONFIG.__setattr__('PMS_UUID', my_uuid)
CONFIG.write()
# Get the currently installed version. Returns None, 'win32' or the git
# hash.
CURRENT_VERSION, CONFIG.GIT_BRANCH = versioncheck.getVersion()
@ -334,3 +341,7 @@ def shutdown(restart=False, update=False):
subprocess.Popen(popen_list, cwd=os.getcwd())
os._exit(0)
def generate_uuid():
logger.debug(u"Generating UUID...")
return uuid.uuid4().hex