Fix for PMP version 1.3.6.699-b7573ff0

This commit is contained in:
samcm 2017-09-24 15:52:06 +10:00
parent 074dcade33
commit fa8127386f
4 changed files with 31 additions and 6 deletions

View File

@ -29,18 +29,40 @@ module.exports = function PlexAuth () {
* @param timeout
* @returns {{url: *, time: boolean, headers: {X-Plex-Device-Name: string, X-Plex-Client-Identifier: string, X-Plex-Provides: string, X-Plex-Target-Client-Identifier: *}, timeout: *, method: string}}
*/
this.getClientApiOptions = function (url, clientIdentifier, uuid, timeout) {
this.getClientApiOptions = function (url, clientIdentifier, uuid, timeout) {
var sBrowser, sUsrAg = navigator.userAgent;
if (sUsrAg.indexOf("Chrome") > -1) {
sBrowser = "Chrome";
} else if (sUsrAg.indexOf("Safari") > -1) {
sBrowser = "Safari";
} else if (sUsrAg.indexOf("Opera") > -1) {
sBrowser = "Opera";
} else if (sUsrAg.indexOf("Firefox") > -1) {
sBrowser = "Firefox";
} else if (sUsrAg.indexOf("MSIE") > -1) {
sBrowser = "Microsoft Internet Explorer";
}
return {
url: url,
time: true,
headers: {
'X-Plex-Device-Name': 'PlexTogether',
'X-Plex-Device-Name': sBrowser ,
'X-Plex-Client-Identifier': 'PlexTogether',
'X-Plex-Provides': 'controller',
'X-Plex-Target-Client-Identifier': clientIdentifier
'X-Plex-Target-Client-Identifier': clientIdentifier,
'X-Plex-Device': 'Web (' + sBrowser + ')',
'X-Plex-Platform': 'PlexTogether',
'X-Plex-Version': '4.18',
'X-Plex-Client-Platform': 'Web',
'X-Plex-Client-Product': 'PlexTogether for Web',
'X-Plex-Product': 'PlexTogether',
'X-Plex-Device-Vendor': sBrowser,
'X-Plex-Platform-Version': '11.0',
'Accept': 'application/json',
'X-Plex-Http-Pipeline': 'infinite'
},
timeout: timeout,
method: 'GET'
}
}
}
}

View File

@ -30,6 +30,8 @@ module.exports = function PlexClient () {
this.tempId = null
this.events = new EventEmitter()
this.userData = null
// Latest objects for reference in the future
this.lastRatingKey = null
this.lastTimelineObject = null
@ -94,7 +96,7 @@ module.exports = function PlexClient () {
}
connection = that.chosenConnection
}
var query = ''
var query = 'type=video&'
for (let key in params) {
query += encodeURIComponent(key) + '=' + encodeURIComponent(params[key]) + '&'
}

View File

@ -102,6 +102,7 @@ module.exports = function () {
}
tempClient.plexConnections = tempConnectionsArray
tempClient.subscribePort = that.httpServerPort
tempClient.userData = that.user
that.clients.push(tempClient)
/*
tempClient.checkConnectability(function(result,me){

View File

@ -750,7 +750,7 @@ const plexTogether = {
function cleanSeek () {
state.decisionBlocked = true
rootState.chosenClient.seekTo(parseInt(hostTimeline.time), function (result) {
console.log('Result from within store for seek was ' + result)
console.log('Result from within store for seek was ', result)
console.log('Setting decision blocked to false ')
state.decisionBlocked = false
})