mirror of
				https://github.com/KevinMidboe/zoff.git
				synced 2025-10-29 18:00:23 +00:00 
			
		
		
		
	Added test serverside to ensure that title is correct + duration isn't insanely much higher that it should be
This commit is contained in:
		
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -1,5 +1,6 @@ | |||||||
| server/public/assets/images/thumbnails/ | server/public/assets/images/thumbnails/ | ||||||
| server/config/mailconfig.js | server/config/mailconfig.js | ||||||
|  | server/config/api_key.js | ||||||
| server/config/mongo_config.js | server/config/mongo_config.js | ||||||
| server/config/cert_config.js | server/config/cert_config.js | ||||||
| server/public/assets/dist/callback.min.js | server/public/assets/dist/callback.min.js | ||||||
|   | |||||||
| @@ -88,8 +88,11 @@ function add_function(arr, coll, guid, offline, socket) { | |||||||
|                                             db.collection(coll).update({views:{$exists:true}}, {$set:{startTime: Functions.get_time()}}); |                                             db.collection(coll).update({views:{$exists:true}}, {$set:{startTime: Functions.get_time()}}); | ||||||
|                                             List.send_play(coll, undefined); |                                             List.send_play(coll, undefined); | ||||||
|                                             Frontpage.update_frontpage(coll, id, title); |                                             Frontpage.update_frontpage(coll, id, title); | ||||||
|  |                                             Search.get_correct_info(new_song, coll, false); | ||||||
|                                         } else { |                                         } else { | ||||||
|                                             io.to(coll).emit("channel", {type: "added", value: {"_id": "asd", "added":added,"guids":guids,"id":id,"now_playing":np,"title":title,"votes":votes, "duration":duration}}); |                                             var new_song = {"_id": "asd", "added":added,"guids":guids,"id":id,"now_playing":np,"title":title,"votes":votes, "duration":duration}; | ||||||
|  |                                             io.to(coll).emit("channel", {type: "added", value: new_song}); | ||||||
|  |                                             Search.get_correct_info(new_song, coll, true); | ||||||
|                                         } |                                         } | ||||||
|                                         db.collection("frontpage_lists").update({_id:coll}, {$inc:{count:1}, $set:{accessed: Functions.get_time()}}, {upsert:true}, function(err, docs){}); |                                         db.collection("frontpage_lists").update({_id:coll}, {$inc:{count:1}, $set:{accessed: Functions.get_time()}}, {upsert:true}, function(err, docs){}); | ||||||
|                                         List.getNextSong(coll); |                                         List.getNextSong(coll); | ||||||
|   | |||||||
| @@ -87,6 +87,7 @@ List = require('./handlers/list.js'); | |||||||
| Suggestions = require('./handlers/suggestions.js'); | Suggestions = require('./handlers/suggestions.js'); | ||||||
| ListSettings = require('./handlers/list_settings.js'); | ListSettings = require('./handlers/list_settings.js'); | ||||||
| Frontpage = require('./handlers/frontpage.js'); | Frontpage = require('./handlers/frontpage.js'); | ||||||
|  | Search = require('./handlers/search.js'); | ||||||
| crypto = require('crypto'); | crypto = require('crypto'); | ||||||
| node_cryptojs = require('node-cryptojs-aes'); | node_cryptojs = require('node-cryptojs-aes'); | ||||||
| CryptoJS = node_cryptojs.CryptoJS; | CryptoJS = node_cryptojs.CryptoJS; | ||||||
|   | |||||||
| @@ -136,6 +136,9 @@ var List = { | |||||||
|                 found_array_index = 0; |                 found_array_index = 0; | ||||||
|                 //if(!w_p) List.dragging(true); |                 //if(!w_p) List.dragging(true); | ||||||
|                 break; |                 break; | ||||||
|  |             case "changed_values": | ||||||
|  |                 List.changedValues(msg.value); | ||||||
|  |                 break; | ||||||
|             case "song_change_prev": |             case "song_change_prev": | ||||||
|                 if(window.location.pathname != "/") List.song_change_prev(msg.time); |                 if(window.location.pathname != "/") List.song_change_prev(msg.time); | ||||||
|                 if(full_playlist.length > 0) { |                 if(full_playlist.length > 0) { | ||||||
| @@ -148,6 +151,20 @@ var List = { | |||||||
|         } |         } | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
|  |     changedValues: function(song) { | ||||||
|  |         var i = List.getIndexOfSong(song.id); | ||||||
|  |         full_playlist[i].title = song.title; | ||||||
|  |         full_playlist[i].duration = song.duration; | ||||||
|  |         full_playlist[i].start = song.start; | ||||||
|  |         full_playlist[i].end = song.end; | ||||||
|  |  | ||||||
|  |         $("#" + song.id).find(".vote-container").attr("title", song.title); | ||||||
|  |         $("#" + song.id).find(".list-title").attr("title", song.title); | ||||||
|  |         $("#" + song.id).find(".list-title").text(song.title); | ||||||
|  |         var _temp_duration = Helper.secondsToOther(song.duration); | ||||||
|  |         $("#" + song.id).find(".card-duration").text(Helper.pad(_temp_duration[0]) + ":" + Helper.pad(_temp_duration[1])); | ||||||
|  |     }, | ||||||
|  |  | ||||||
|     insertAtBeginning: function(song_info, transition) { |     insertAtBeginning: function(song_info, transition) { | ||||||
|         var display = List.page == 0 ? "" : "none"; |         var display = List.page == 0 ? "" : "none"; | ||||||
|         var add = List.generateSong(song_info, transition, false, true, false, display, false); |         var add = List.generateSong(song_info, transition, false, true, false, display, false); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user