Merge remote-tracking branch 'origin/master'
# Conflicts: # app/package.json
This commit is contained in:
commit
1d591b4867
|
@ -132,7 +132,7 @@ Once the above is done you're all set! Depending on whether you're the host or a
|
||||||
----
|
----
|
||||||
## Issues
|
## Issues
|
||||||
If you run in to any issues:
|
If you run in to any issues:
|
||||||
* Raise an Issue here on Github. Try to be as detailed as possible by including details such as
|
* Raise an Issue here on Github. Try to be as detailed as possible by including details such as:
|
||||||
* Node Version
|
* Node Version
|
||||||
* Operating System
|
* Operating System
|
||||||
* Plex Media Server details
|
* Plex Media Server details
|
||||||
|
@ -149,7 +149,7 @@ If you run in to any issues:
|
||||||
* Send the log file to anyone who is in the Discord group "Developer" with a link to the Github Issue. Although the log file does not contain any access tokens, it is still not recommended to post your log file publicly.
|
* Send the log file to anyone who is in the Discord group "Developer" with a link to the Github Issue. Although the log file does not contain any access tokens, it is still not recommended to post your log file publicly.
|
||||||
* Obtain your log file from here:
|
* Obtain your log file from here:
|
||||||
* on Linux: ~/.config/PlexTogether/log.log
|
* on Linux: ~/.config/PlexTogether/log.log
|
||||||
* on OS X: ~/Library/Logs/PlexTogether/log.log
|
* on macOS: ~/Library/Logs/PlexTogether/log.log
|
||||||
* on Windows: %USERPROFILE%/AppData/Roaming/PlexTogether/log.log
|
* on Windows: %USERPROFILE%/AppData/Roaming/PlexTogether/log.log
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
|
@ -8,7 +8,7 @@ const spawn = require('child_process').spawn;
|
||||||
global.log = require('electron-log');
|
global.log = require('electron-log');
|
||||||
global.log.transports.file.format = '[App] [{level}] {h}:{i}:{s}:{ms} {text}';
|
global.log.transports.file.format = '[App] [{level}] {h}:{i}:{s}:{ms} {text}';
|
||||||
|
|
||||||
const storage = require('electron-json-storage');
|
global.storage = require('electron-json-storage');
|
||||||
|
|
||||||
global.io = require('socket.io-client');
|
global.io = require('socket.io-client');
|
||||||
global.socket = null;
|
global.socket = null;
|
||||||
|
@ -127,7 +127,7 @@ app.on('ready', function() {
|
||||||
--> If token is valid, send to Home
|
--> If token is valid, send to Home
|
||||||
--> If token is not valid, send to Plex Login Screen
|
--> If token is not valid, send to Plex Login Screen
|
||||||
*/
|
*/
|
||||||
storage.get('plex-together-settings', function(error, data) {
|
global.storage.get('plex-together-settings', function(error, data) {
|
||||||
if (error) throw error;
|
if (error) throw error;
|
||||||
if (data.plextvtoken != null){
|
if (data.plextvtoken != null){
|
||||||
//We have a token
|
//We have a token
|
||||||
|
@ -273,7 +273,7 @@ ipcMain.on('plextv-signin', function(event,username,password){
|
||||||
//Sign in button pressed on Sign In page
|
//Sign in button pressed on Sign In page
|
||||||
plex.doStandardLogin(username,password,function(result){
|
plex.doStandardLogin(username,password,function(result){
|
||||||
if (result == 201){
|
if (result == 201){
|
||||||
storage.set('plex-together-settings',{'plextvtoken':plex.user.authToken}, function(error) {
|
global.storage.set('plex-together-settings',{'plextvtoken':plex.user.authToken}, function(error) {
|
||||||
if (error) throw error;
|
if (error) throw error;
|
||||||
});
|
});
|
||||||
plex.getDevices(function(devicesResult){
|
plex.getDevices(function(devicesResult){
|
||||||
|
@ -293,7 +293,7 @@ ipcMain.on('plextv-signin', function(event,username,password){
|
||||||
});
|
});
|
||||||
ipcMain.on('plextv-signout',function(event){
|
ipcMain.on('plextv-signout',function(event){
|
||||||
introWindow.loadURL('file://' + __dirname + '/signin.html')
|
introWindow.loadURL('file://' + __dirname + '/signin.html')
|
||||||
storage.set('plex-together-settings',{'plextvtoken':""}, function(error) {
|
global.storage.set('plex-together-settings',{'plextvtoken':""}, function(error) {
|
||||||
if (error) throw error;
|
if (error) throw error;
|
||||||
});
|
});
|
||||||
mainWindow.minimize();
|
mainWindow.minimize();
|
||||||
|
|
|
@ -77,15 +77,16 @@ function connectToPTServer(address){
|
||||||
document.getElementById('ptServerPreloader').style.opacity = 1
|
document.getElementById('ptServerPreloader').style.opacity = 1
|
||||||
global.renderLog.info('connecting to ' + address)
|
global.renderLog.info('connecting to ' + address)
|
||||||
ipcRenderer.send('connect-to-ptserver',address)
|
ipcRenderer.send('connect-to-ptserver',address)
|
||||||
//global.socket = io.connect('au1.plextogether.com',{'sync disconnect on unload':true
|
//global.socket = io.connect('au1.plextogether.com',{'sync disconnect on unload':true
|
||||||
// global.socket = io.connect('localhost',{'sync disconnect on unload':true})
|
// global.socket = io.connect('localhost',{'sync disconnect on unload':true})
|
||||||
ipcRenderer.on('connect-ptserver-fail',function(event){
|
ipcRenderer.on('connect-ptserver-fail',function(event){
|
||||||
global.renderLog.info('FAILED TO CONNECT TO THE PTSERVER')
|
global.renderLog.info('FAILED TO CONNECT TO THE PTSERVER')
|
||||||
$('#serverSuccess').addClass('hide')
|
$('#serverSuccess').addClass('hide')
|
||||||
document.getElementById('ptServerPreloader').style.opacity = 0
|
document.getElementById('ptServerPreloader').style.opacity = 0
|
||||||
})
|
})
|
||||||
ipcRenderer.on('connect-ptserver-success',function(event){
|
ipcRenderer.on('connect-ptserver-success',function(event){
|
||||||
document.getElementById('ptServerPreloader').style.opacity = 0
|
saveCustomPTServer(address);
|
||||||
|
document.getElementById('ptServerPreloader').style.opacity = 0
|
||||||
$('#serverSuccess').removeClass('hide')
|
$('#serverSuccess').removeClass('hide')
|
||||||
document.getElementById('ptRoom').focus()
|
document.getElementById('ptRoom').focus()
|
||||||
ipcRenderer.send('pt-server-address-change',address)
|
ipcRenderer.send('pt-server-address-change',address)
|
||||||
|
@ -93,7 +94,7 @@ function connectToPTServer(address){
|
||||||
}
|
}
|
||||||
function joinPTRoom(){
|
function joinPTRoom(){
|
||||||
global.renderLog.info('attempting to join room')
|
global.renderLog.info('attempting to join room')
|
||||||
let wantedRoom = document.getElementById('ptRoom').value
|
let wantedRoom = document.getElementById('ptRoom').value
|
||||||
if (wantedRoom === '' || wantedRoom === null){
|
if (wantedRoom === '' || wantedRoom === null){
|
||||||
global.renderLog.info('Choose the room you\'d like to join first!')
|
global.renderLog.info('Choose the room you\'d like to join first!')
|
||||||
return
|
return
|
||||||
|
@ -111,14 +112,14 @@ function joinPTRoom(){
|
||||||
function handleRoomJoinAttempt(result,data,details,currentUsers){
|
function handleRoomJoinAttempt(result,data,details,currentUsers){
|
||||||
global.renderLog.info(currentUsers)
|
global.renderLog.info(currentUsers)
|
||||||
if (result){
|
if (result){
|
||||||
//Join successful
|
//Join successful
|
||||||
//Now we'll pass over control to roomEvents in homejs to handle everything
|
//Now we'll pass over control to roomEvents in homejs to handle everything
|
||||||
ipcRenderer.send('pt-server-room-change',data.room,document.getElementById('ptRoomPassword').value)
|
ipcRenderer.send('pt-server-room-change',data.room,document.getElementById('ptRoomPassword').value)
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
ipcRenderer.send('join-room-ok',data,details,currentUsers,global.socket)
|
ipcRenderer.send('join-room-ok',data,details,currentUsers,global.socket)
|
||||||
ipcRenderer.send('pt-server-showInfo')
|
ipcRenderer.send('pt-server-showInfo')
|
||||||
},150)
|
},150)
|
||||||
} else {
|
} else {
|
||||||
//Join FAILED
|
//Join FAILED
|
||||||
if (details == 'wrong password'){
|
if (details == 'wrong password'){
|
||||||
global.renderLog.info('wrong password')
|
global.renderLog.info('wrong password')
|
||||||
|
@ -136,3 +137,30 @@ function getHandshakeUser(){
|
||||||
}
|
}
|
||||||
return tempUser
|
return tempUser
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getSavedCustomPTServer(input){
|
||||||
|
console.log("Loading custom server from storage");
|
||||||
|
var storage = remote.getGlobal('storage');
|
||||||
|
storage.get('plex-together-custom-settings', function(error, data) {
|
||||||
|
if (error) throw error;
|
||||||
|
if(data.customPTServer != null){
|
||||||
|
console.log("custom PT is defined " + data.customPTServer);
|
||||||
|
input.val(data.customPTServer);
|
||||||
|
}else{
|
||||||
|
//if key doesn't exists, create one with value "http://"
|
||||||
|
input.val("http://");
|
||||||
|
storage.set('plex-together-custom-settings',{'customPTServer':"http://"}, function(error) {
|
||||||
|
if (error) throw error;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function saveCustomPTServer(address){
|
||||||
|
console.log("Saving custom server " + address + " to storage");
|
||||||
|
var storage = remote.getGlobal('storage');
|
||||||
|
storage.set('plex-together-custom-settings',{'customPTServer':address}, function(error) {
|
||||||
|
if (error) throw error;
|
||||||
|
});
|
||||||
|
return address
|
||||||
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
"jquery": "2.1.1",
|
"jquery": "2.1.1",
|
||||||
"mkdirp": "0.5.1",
|
"mkdirp": "0.5.1",
|
||||||
"portfinder": "^1.0.10",
|
"portfinder": "^1.0.10",
|
||||||
|
"remote": "^0.2.6",
|
||||||
"request": "2.74.0",
|
"request": "2.74.0",
|
||||||
"safe-json-parse": "4.0.0",
|
"safe-json-parse": "4.0.0",
|
||||||
"socket.io": "1.4.8",
|
"socket.io": "1.4.8",
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<div class="settingsTitle">
|
<div class="settingsTitle">
|
||||||
<div class="row" style="margin-bottom: 0;">
|
<div class="row" style="margin-bottom: 0;">
|
||||||
<div class="col s12">
|
<div class="col s12">
|
||||||
<div>
|
<div>
|
||||||
|
@ -47,8 +47,8 @@
|
||||||
<div class="col s8">
|
<div class="col s8">
|
||||||
<div class="input-field windowNoDrag">
|
<div class="input-field windowNoDrag">
|
||||||
<select id="PlexTogetherServers" class="browser-default" onchange="ServerSelectedChanged()">
|
<select id="PlexTogetherServers" class="browser-default" onchange="ServerSelectedChanged()">
|
||||||
<option value="" disabled selected>Select a PT Server</option>
|
<option value="" disabled>Select a PT Server</option>
|
||||||
<option value="custom">Custom</option>
|
<option value="custom" selected>Custom</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
<i class="material-icons close hide" id="serverSuccess" style="color: #1ECD97; margin-top: 24px; margin-left: -75px">check_circle</i>
|
<i class="material-icons close hide" id="serverSuccess" style="color: #1ECD97; margin-top: 24px; margin-left: -75px">check_circle</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row hide" id="customField">
|
<div class="row" id="customField">
|
||||||
<div class="col s8">
|
<div class="col s8">
|
||||||
<div class="input-field col s12">
|
<div class="input-field col s12">
|
||||||
<input id="ptServerCustom" type="text" class="validate" value="http://" style="margin-bottom: 0px;">
|
<input id="ptServerCustom" type="text" class="validate" value="http://" style="margin-bottom: 0px;">
|
||||||
|
@ -144,6 +144,8 @@
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('select').material_select();
|
$('select').material_select();
|
||||||
|
//set custom PTS to the custom server input
|
||||||
|
getSavedCustomPTServer($('#ptServerCustom'));
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
Loading…
Reference in New Issue