Procházet zdrojové kódy

Minor changes to syntax, fixed some redis depreciation error.

theflametrooper před 8 roky
rodič
revize
91f4c40180

+ 3 - 1
backend/logic/actions/stations.js

@@ -84,15 +84,17 @@ module.exports = {
 		// and it should probably just a different cache table then 'stations'
 		cache.hgetall('stations', (err, stations) => {
 
+			console.log('all', stations)
+
 			if (err && err !== true) {
 				return cb({
 					status: 'error',
 					message: 'An error occurred while obtaining the stations'
 				});
 			}
+
 			let arr = [];
 			for (let prop in stations) {
-				console.log(prop);
 				arr.push(stations[prop]);
 			}
 

+ 0 - 1
backend/logic/app.js

@@ -5,7 +5,6 @@
 const express = require('express');
 const bodyParser = require('body-parser');
 const cors = require('cors');
-
 const config = require('config');
 
 const lib = {

+ 1 - 1
backend/logic/cache/index.js

@@ -54,7 +54,7 @@ const lib = {
 		// automatically stringify objects and arrays into JSON
 		if (stringifyJson && ['object', 'array'].includes(typeof value)) value = JSON.stringify(value);
 
-		lib.client.hset(table, key, value, (err) => {
+		lib.client.hset(table, key, value, err => {
 			if (cb !== undefined) {
 				if (err) return cb(err);
 				cb(null);

+ 2 - 2
backend/logic/io.js

@@ -55,7 +55,7 @@ module.exports = {
 						let cb = arguments[arguments.length - 1];
 
 						// load the session from the cache
-						cache.hget('sessions', socket.sessionId, (err, session) => {
+						/*if (socket.sessionId !== undefined)*/ cache.hget('sessions', socket.sessionId, (err, session) => {
 							if (err && err !== true) {
 								return cb({
 									status: 'error',
@@ -81,7 +81,7 @@ module.exports = {
 			});
 
 			//TODO check if session is valid before returning true/false
-			cache.hget('sessions', socket.sessionId, (err, session) => {
+			if (socket.sessionId !== undefined) cache.hget('sessions', socket.sessionId, (err, session) => {
 				if (err && err !== true) {
 					socket.emit('ready', false);
 				} else if (session) {

+ 0 - 1
frontend/components/Station/Station.vue

@@ -248,7 +248,6 @@
 				this.playVideo();
 			});*/
 
-			lofig.folder = '../config/default.json';
 			lofig.get('socket.url', function(res) {
 				_this.stationSocket = io(window.location.protocol + '//' + res + '/' + _this.$route.params.id);