Explorar el Código

Fixed more issues with stations and removed debugging.

KrisVos130 hace 8 años
padre
commit
03e4f84835

+ 0 - 5
backend/logic/actions/stations.js

@@ -40,9 +40,7 @@ cache.sub('station.queueUpdate', stationId => {
 });
 
 cache.sub('station.create', stationId => {
-	console.log(111);
 	stations.initializeStation(stationId, (err, station) => {
-		console.log(err, station);
 		//TODO Emit to homepage and admin station page
 		if (!err) {
 			io.io.to('home').emit("event:stations.created", station);
@@ -331,11 +329,8 @@ module.exports = {
 			}
 
 		], (err, station) => {
-			console.log(1234567);
 			if (err) throw err;
-			console.log(123456789);
 			cache.pub('station.create', data._id);
-			console.log(123456723213);
 			return cb(null, { 'status': 'success', 'message': 'Successfully created station.' });
 		});
 	}),

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

@@ -140,7 +140,6 @@ const lib = {
 			subs[channel] = { client: redis.createClient({ url: lib.url }), cbs: [] };
 			subs[channel].client.on('error', (err) => console.error);
 			subs[channel].client.on('message', (channel, message) => {
-				console.log("MESSAGE", channel, message);
 				if (parseJson) try { message = JSON.parse(message); } catch (e) {}
 				subs[channel].cbs.forEach((cb) => cb(message));
 			});

+ 3 - 3
backend/logic/stations.js

@@ -34,15 +34,15 @@ module.exports = {
 		});
 	},
 
-	initializeStation: function(_station, cb) {
+	initializeStation: function(stationId, cb) {
 		if (typeof cb !== 'function') cb = ()=>{};
 		let _this = this;
-		_this.getStation(_station._id, (err, station) => {
+		_this.getStation(stationId, (err, station) => {
 			if (!err) {
 				if (station) {
 					let notification = notifications.subscribe(`stations.nextSong?id=${station._id}`, () => {
 						console.log("NOTIFICATION!!!");
-						_this.getStation(_station._id, (err, station) => {
+						_this.getStation(stationId, (err, station) => {
 							if (station) {
 								// notify all the sockets on this station to go to the next song
 								async.waterfall([