mirror of
				https://github.com/KevinMidboe/zoff.git
				synced 2025-10-29 18:00:23 +00:00 
			
		
		
		
	Added not found and logging
This commit is contained in:
		| @@ -610,13 +610,7 @@ var List = { | |||||||
|         console.log(thisSong, i); |         console.log(thisSong, i); | ||||||
|         if(i >= full_playlist.length) { |         if(i >= full_playlist.length) { | ||||||
|             console.log(result, List.found, List.not_found); |             console.log(result, List.found, List.not_found); | ||||||
|             SC_player.post('/playlists', { |             if(List.found.length == 0) { | ||||||
|                 playlist: { |  | ||||||
|                     title: chan.toLowerCase() + " - Zoff", |  | ||||||
|                     tracks: List.found, |  | ||||||
|                 } |  | ||||||
|             }).then(function(result) { |  | ||||||
|                 console.log(result, List.found, List.not_found); |  | ||||||
|                 for(var x = 0; x < List.not_found.length; x++) { |                 for(var x = 0; x < List.not_found.length; x++) { | ||||||
|                     var data = List.not_found[x]; |                     var data = List.not_found[x]; | ||||||
|                     var not_added_song = document.createElement("div"); |                     var not_added_song = document.createElement("div"); | ||||||
| @@ -628,12 +622,34 @@ var List = { | |||||||
|                 Helper.addClass(".current_number", "hide"); |                 Helper.addClass(".current_number", "hide"); | ||||||
|                 Helper.addClass("#playlist_loader_export", "hide"); |                 Helper.addClass("#playlist_loader_export", "hide"); | ||||||
|                 Helper.addClass(".exported-list-container", "hide"); |                 Helper.addClass(".exported-list-container", "hide"); | ||||||
|                 document.querySelector(".exported-list").insertAdjacentHTML("beforeend", "<a target='_blank' class='btn light exported-playlist exported-spotify-list' href='" + result.permalink_url + "'>" + result.title + "</a>"); |  | ||||||
|                 List.found = []; |                 List.found = []; | ||||||
|                 List.not_found = []; |                 List.not_found = []; | ||||||
|             }).catch(function(error) { |             } else { | ||||||
|                 console.log(error); |                 SC_player.post('/playlists', { | ||||||
|             }); |                     playlist: { | ||||||
|  |                         title: chan.toLowerCase() + " - Zoff", | ||||||
|  |                         tracks: List.found, | ||||||
|  |                     } | ||||||
|  |                 }).then(function(result) { | ||||||
|  |                     console.log(result, List.found, List.not_found); | ||||||
|  |                     for(var x = 0; x < List.not_found.length; x++) { | ||||||
|  |                         var data = List.not_found[x]; | ||||||
|  |                         var not_added_song = document.createElement("div"); | ||||||
|  |                         not_added_song.innerHTML = not_export_html; | ||||||
|  |                         not_added_song.querySelector(".extra-add-text").setAttribute("value", data); | ||||||
|  |                         not_added_song.querySelector(".extra-add-text").setAttribute("title", data); | ||||||
|  |                         document.querySelector(".not-exported-container").insertAdjacentHTML("beforeend", not_added_song.innerHTML); | ||||||
|  |                     } | ||||||
|  |                     Helper.addClass(".current_number", "hide"); | ||||||
|  |                     Helper.addClass("#playlist_loader_export", "hide"); | ||||||
|  |                     Helper.addClass(".exported-list-container", "hide"); | ||||||
|  |                     document.querySelector(".exported-list").insertAdjacentHTML("beforeend", "<a target='_blank' class='btn light exported-playlist exported-spotify-list' href='" + result.permalink_url + "'>" + result.title + "</a>"); | ||||||
|  |                     List.found = []; | ||||||
|  |                     List.not_found = []; | ||||||
|  |                 }).catch(function(error) { | ||||||
|  |                     console.log(error); | ||||||
|  |                 }); | ||||||
|  |             } | ||||||
|         } else if(thisSong == undefined) { |         } else if(thisSong == undefined) { | ||||||
|             if(full_playlist.length > 0) { |             if(full_playlist.length > 0) { | ||||||
|                 List.exportToSoundCloud(full_playlist[0], 0); |                 List.exportToSoundCloud(full_playlist[0], 0); | ||||||
| @@ -664,8 +680,10 @@ var List = { | |||||||
|                             if(title.indexOf(song.user.username) == -1) { |                             if(title.indexOf(song.user.username) == -1) { | ||||||
|                                 title = song.user.username +  " - " + title; |                                 title = song.user.username +  " - " + title; | ||||||
|                             } |                             } | ||||||
|  |                             title = title.toLowerCase(); | ||||||
|                             var id=song.id; |                             var id=song.id; | ||||||
|                             if(similarity(title, thisSong.track) > 0.60) { |                             console.log(title, thisSong.title, similarity(title, thisSong.title)); | ||||||
|  |                             if(similarity(title, thisSong.title) > 0.60) { | ||||||
|                                 List.found.push({id: parseInt(song.id)}); |                                 List.found.push({id: parseInt(song.id)}); | ||||||
|                                 isFound = true; |                                 isFound = true; | ||||||
|                                 break; |                                 break; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user