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,6 +610,21 @@ 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);
 | 
				
			||||||
 | 
					            if(List.found.length == 0) {
 | 
				
			||||||
 | 
					                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");
 | 
				
			||||||
 | 
					                List.found = [];
 | 
				
			||||||
 | 
					                List.not_found = [];
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
                SC_player.post('/playlists', {
 | 
					                SC_player.post('/playlists', {
 | 
				
			||||||
                    playlist: {
 | 
					                    playlist: {
 | 
				
			||||||
                        title: chan.toLowerCase() + " - Zoff",
 | 
					                        title: chan.toLowerCase() + " - Zoff",
 | 
				
			||||||
@@ -634,6 +649,7 @@ var List = {
 | 
				
			|||||||
                }).catch(function(error) {
 | 
					                }).catch(function(error) {
 | 
				
			||||||
                    console.log(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