mirror of
				https://github.com/KevinMidboe/zoff.git
				synced 2025-10-29 18:00:23 +00:00 
			
		
		
		
	Added a function to log last logs, in case of any crashes
This commit is contained in:
		| @@ -21,6 +21,10 @@ function removeAllListeners() { | |||||||
|     socket.removeEventListener(id); |     socket.removeEventListener(id); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | function list_last_logs() { | ||||||
|  |     console.log(JSON.stringify(Helper.logs)); | ||||||
|  | } | ||||||
|  |  | ||||||
| function filterPlaylistElements(page) { | function filterPlaylistElements(page) { | ||||||
|     var value = document.getElementById("filtersearch_input").value; |     var value = document.getElementById("filtersearch_input").value; | ||||||
|     var search_type = document.querySelector(".category-advanced-select").value; |     var search_type = document.querySelector(".category-advanced-select").value; | ||||||
|   | |||||||
| @@ -40,10 +40,14 @@ var Helper = { | |||||||
|             } |             } | ||||||
|             console.log("------------ " + new Date() + " ------------");/*RemoveLogging:skip*/ |             console.log("------------ " + new Date() + " ------------");/*RemoveLogging:skip*/ | ||||||
|         } |         } | ||||||
|         Helper.logs.unshift({log: to_log, date: new Date()}); |         try { | ||||||
|         if(Helper.logs.length > 10) { |             if(to_log[0] != "FULL PLAYLIST") { | ||||||
|             Helper.logs.splice(-1, Helper.logs.length - 10); |                 Helper.logs.unshift({log: to_log, date: new Date()}); | ||||||
|         } |                 if(Helper.logs.length > 10) { | ||||||
|  |                     Helper.logs.splice(-1, Helper.logs.length - 10); | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |         } catch(e){} | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
|     rnd: function(arr) { |     rnd: function(arr) { | ||||||
|   | |||||||
| @@ -177,7 +177,8 @@ try{ | |||||||
|  |  | ||||||
| window.zoff = { | window.zoff = { | ||||||
|     enable_debug: enable_debug, |     enable_debug: enable_debug, | ||||||
|     disable_debug: disable_debug |     disable_debug: disable_debug, | ||||||
|  |     list_last_logs: list_last_logs | ||||||
| } | } | ||||||
|  |  | ||||||
| /*if(!Helper.mobilecheck() && (window.location.host != "localhost" && window.location.host != "client.localhost")) { | /*if(!Helper.mobilecheck() && (window.location.host != "localhost" && window.location.host != "client.localhost")) { | ||||||
|   | |||||||
| @@ -1084,6 +1084,10 @@ var Player = { | |||||||
|                 if(videoSource == "soundcloud") { |                 if(videoSource == "soundcloud") { | ||||||
|                     if(scUsingWidget) { |                     if(scUsingWidget) { | ||||||
|                         Player.soundcloud_player.isPaused(function(playing) { |                         Player.soundcloud_player.isPaused(function(playing) { | ||||||
|  |                             if(!playing) { | ||||||
|  |                                 Helper.removeClass("#play", "hide"); | ||||||
|  |                                 Helper.addClass("#pause", "hide"); | ||||||
|  |                             } | ||||||
|                             playing = !playing; |                             playing = !playing; | ||||||
|                             if(Math.ceil(currDurr) + 1 > Player.np.end && playing) { |                             if(Math.ceil(currDurr) + 1 > Player.np.end && playing) { | ||||||
|                                 end_programmatically = true; |                                 end_programmatically = true; | ||||||
| @@ -1097,6 +1101,10 @@ var Player = { | |||||||
|                             } |                             } | ||||||
|                         }) |                         }) | ||||||
|                     } else { |                     } else { | ||||||
|  |                         if(Player.soundcloud_player.isPlaying()) { | ||||||
|  |                             Helper.removeClass("#play", "hide"); | ||||||
|  |                             Helper.addClass("#pause", "hide"); | ||||||
|  |                         } | ||||||
|                         if(Math.ceil(currDurr) + 1 > Player.np.end && Player.soundcloud_player.isPlaying()) { |                         if(Math.ceil(currDurr) + 1 > Player.np.end && Player.soundcloud_player.isPlaying()) { | ||||||
|                             end_programmatically = true; |                             end_programmatically = true; | ||||||
|                             if(!offline) { |                             if(!offline) { | ||||||
| @@ -1109,9 +1117,12 @@ var Player = { | |||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|                 } else { |                 } else { | ||||||
|  |                     if(Player.player.getPlayerState() == 1) { | ||||||
|  |                         Helper.removeClass("#play", "hide"); | ||||||
|  |                         Helper.addClass("#pause", "hide"); | ||||||
|  |                     } | ||||||
|                     if(Math.ceil(Player.player.getCurrentTime()) >= Player.np.end && (Player.player.getPlayerState() == YT.PlayerState.PLAYING)) { |                     if(Math.ceil(Player.player.getCurrentTime()) >= Player.np.end && (Player.player.getPlayerState() == YT.PlayerState.PLAYING)) { | ||||||
|                         end_programmatically = true; |                         end_programmatically = true; | ||||||
|  |  | ||||||
|                         if(!offline) { |                         if(!offline) { | ||||||
|                             Player.player.pauseVideo(); |                             Player.player.pauseVideo(); | ||||||
|                             was_stopped = false; |                             was_stopped = false; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user