From 46d0284ba90d83dcabfe0822ac77542868c01dc6 Mon Sep 17 00:00:00 2001 From: Sam Date: Sun, 27 May 2018 02:34:14 +1000 Subject: [PATCH] OAuth Client Identifier --- src/components/application/ptplayer.vue | 3 ++- src/components/signin.vue | 2 +- src/store.js | 8 +++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/application/ptplayer.vue b/src/components/application/ptplayer.vue index f612295a..3a930a14 100644 --- a/src/components/application/ptplayer.vue +++ b/src/components/application/ptplayer.vue @@ -196,7 +196,8 @@ export default { this.lastSentTimeline = playerdata if (this.playerTime) { this.eventbus.$emit('ptplayer-poll', (time) => { - console.log('Poll time was out by', Math.abs(time - this.playertime)) + let difference = Math.abs(time - this.playertime) + console.log('Poll time was out by', difference) playerdata.time = time this.playertime = time data.callback(playerdata) diff --git a/src/components/signin.vue b/src/components/signin.vue index 6f29ddd3..bdb5c92a 100644 --- a/src/components/signin.vue +++ b/src/components/signin.vue @@ -62,7 +62,7 @@ export default { 'X-Plex-Product': 'SyncLounge', 'X-Plex-Version': this.$store.state.appVersion, 'X-Plex-Platform-Version': '', - 'X-Plex-Client-Identifier': 'SyncLounge v' + this.$store.state.appVersion + 'X-Plex-Client-Identifier': this.$store.state.settings.CLIENTIDENTIFIER }, code: null, ready: false diff --git a/src/store.js b/src/store.js index e6bf7358..11a1207c 100644 --- a/src/store.js +++ b/src/store.js @@ -37,7 +37,8 @@ let defaultSettings = { SYNCMODE: 'cleanseak', SYNCFLEXABILITY: 3000, CUSTOMSERVER: 'http://', - SLPLAYERFORCETRANSCODE: true + SLPLAYERFORCETRANSCODE: true, + CLIENTIDENTIFIER: generateGuid() + '-' + generateGuid() } for (let i in defaultSettings) { if (getSetting(i) === undefined || getSetting(i) === null) { @@ -50,7 +51,7 @@ function generateGuid () { .toString(16) .substring(1) } - return s4() + s4() + s4() + s4() + return s4() + s4() + '-' + s4() + s4() } // Set up out web app socket for fetching short urls @@ -89,7 +90,8 @@ const state = { PTPLAYERVOLUME: getSetting('PTPLAYERVOLUME'), SLPLAYERFORCETRANSCODE: getSetting('SLPLAYERFORCETRANSCODE'), HIDEUSERNAME: getSetting('HIDEUSERNAME'), - ALTUSERNAME: getSetting('ALTUSERNAME') + ALTUSERNAME: getSetting('ALTUSERNAME'), + CLIENTIDENTIFIER: getSetting('CLIENTIDENTIFIER') }, LASTSERVER: getSetting('LASTSERVER'),