From 7f1a4ec34a4f9961a96f3985b2fe53d2071bdd57 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Wed, 22 Jul 2020 18:00:58 -0700 Subject: [PATCH] Add return PMS name and server ID from device registration --- API.md | 5 ++++- plexpy/api2.py | 14 +++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/API.md b/API.md index c9aea64c..f7b70089 100644 --- a/API.md +++ b/API.md @@ -2682,7 +2682,10 @@ Optional parameters: onesignal_id (str): The OneSignal id for the mobile device Returns: - None + json: + {"pms_name": "Winterfell-Server", + "server_id": "ds48g4r354a8v9byrrtr697g3g79w" + } ``` diff --git a/plexpy/api2.py b/plexpy/api2.py index cf022c8c..73239b23 100644 --- a/plexpy/api2.py +++ b/plexpy/api2.py @@ -404,7 +404,10 @@ class API2(object): onesignal_id (str): The OneSignal id for the mobile device Returns: - None + json: + {"pms_name": "Winterfell-Server", + "server_id": "ds48g4r354a8v9byrrtr697g3g79w" + } ``` """ if not device_id: @@ -426,7 +429,16 @@ class API2(object): if result: self._api_msg = 'Device registration successful.' self._api_result_type = 'success' + mobile_app.set_temp_device_token(None) + + data = { + "pms_name": plexpy.CONFIG.PMS_NAME, + "server_id": plexpy.CONFIG.PMS_UUID + } + + return data + else: self._api_msg = 'Device registration failed: database error.' self._api_result_type = 'error'