mirror of
				https://github.com/KevinMidboe/zoff.git
				synced 2025-10-29 18:00:23 +00:00 
			
		
		
		
	Fixed issue with correct title not returning result
This commit is contained in:
		| @@ -45,16 +45,24 @@ function get_correct_info(song_generated, channel, broadcast, callback) { | ||||
|                                 io.to(channel).emit("channel", {type: "changed_values", value: song_generated}); | ||||
|                             } | ||||
|                         } else { | ||||
|                             if(typeof(callback) == "function") { | ||||
|                                 callback(song_generated, true); | ||||
|                             } | ||||
|                         } | ||||
|                     }); | ||||
|                 } else { | ||||
|                     if(typeof(callback) == "function") { | ||||
|                         callback(song_generated, true); | ||||
|                     } | ||||
|                 } | ||||
|             } else { | ||||
|                 findSimilar(song_generated, channel, broadcast, callback) | ||||
|             } | ||||
|         } catch(e){ | ||||
|             if(typeof(callback) == "function") { | ||||
|                 callback({}, false); | ||||
|             } | ||||
|         } | ||||
|     }); | ||||
| } | ||||
|  | ||||
| @@ -123,7 +131,7 @@ function findSimilar(msg, channel, broadcast, callback) { | ||||
|                                 io.to(channel).emit("channel", {type: "changed_values", value: element}); | ||||
|                             } | ||||
|                         } | ||||
|                         if(callback) { | ||||
|                         if(typeof(callback) == "function") { | ||||
|                             msg.title = element.title; | ||||
|                             msg.id = element.id; | ||||
|                             msg.duration = element.duration; | ||||
| @@ -132,7 +140,7 @@ function findSimilar(msg, channel, broadcast, callback) { | ||||
|                             callback(msg, true); | ||||
|                         } | ||||
|                     }); | ||||
|                 } else if(callback) { | ||||
|                 } else if(typeof(callback) == "function") { | ||||
|                     callback({}, false); | ||||
|                 } | ||||
|             }); | ||||
|   | ||||
| @@ -381,7 +381,6 @@ router.route('/api/list/:channel_name/:video_id').post(function(req,res) { | ||||
|     res.header("Access-Control-Allow-Origin", "*"); | ||||
|     res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); | ||||
|     res.header({"Content-Type": "application/json"}); | ||||
|  | ||||
|     var fetch_only = false; | ||||
|     if(req.body.hasOwnProperty('fetch_song')) { | ||||
|         fetch_only = true; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user