mirror of
https://github.com/meisnate12/Plex-Meta-Manager
synced 2024-11-10 06:54:21 +00:00
[17] Give each PMM a unique Identifier
This commit is contained in:
parent
1174499129
commit
c523492b87
2 changed files with 17 additions and 3 deletions
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
1.16.5-develop16
|
||||
1.16.5-develop17
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import argparse, os, sys, time, traceback
|
||||
import argparse, os, sys, time, traceback, uuid
|
||||
from datetime import datetime
|
||||
|
||||
try:
|
||||
|
@ -123,7 +123,21 @@ with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "VERSION")) a
|
|||
version = util.parse_version(line)
|
||||
break
|
||||
|
||||
plexapi.BASE_HEADERS["X-Plex-Client-Identifier"] = "Plex-Meta-Manager"
|
||||
uuid_file = os.path.join(default_dir, "UUID")
|
||||
uuid_num = None
|
||||
if os.path.exists(uuid_file):
|
||||
with open(uuid_file) as handle:
|
||||
for line in handle.readlines():
|
||||
line = line.strip()
|
||||
if len(line) > 0:
|
||||
uuid_num = line
|
||||
break
|
||||
if not uuid_num:
|
||||
uuid_num = uuid.uuid4()
|
||||
with open(uuid_file, "w") as handle:
|
||||
handle.write(str(uuid_num))
|
||||
|
||||
plexapi.BASE_HEADERS["X-Plex-Client-Identifier"] = str(uuid_num)
|
||||
|
||||
def start(attrs):
|
||||
logger.add_main_handler()
|
||||
|
|
Loading…
Reference in a new issue