mirror of
				https://github.com/KevinMidboe/zoff.git
				synced 2025-10-29 18:00:23 +00:00 
			
		
		
		
	Fix for suggestions not correctly work for soundcloud
This commit is contained in:
		@@ -1316,8 +1316,12 @@ var List = {
 | 
			
		||||
            song.querySelector(attr).setAttribute("data-video-title", video_title);
 | 
			
		||||
            song.querySelector(attr).setAttribute("data-video-length", _song_info.length);
 | 
			
		||||
            song.querySelector(attr).setAttribute("data-added-by", added_by);
 | 
			
		||||
            song.querySelector("#list-song").setAttribute("data-video-type", "suggested");
 | 
			
		||||
            song.querySelector("#list-song").setAttribute("data-video-source", "youtube");
 | 
			
		||||
            song.querySelector(attr).setAttribute("data-video-type", "suggested");
 | 
			
		||||
            if(_song_info.source == "soundcloud") {
 | 
			
		||||
                song.querySelector(attr).setAttribute("data-type-thumbnail", _song_info.thumbnail);
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
            song.querySelector(attr).setAttribute("data-video-source", _song_info.source);
 | 
			
		||||
            song.querySelector("#list-song").setAttribute("data-video-id", video_id);
 | 
			
		||||
            Helper.css(song.querySelector("#list-song"), "display", "inline-flex");
 | 
			
		||||
            song.querySelector("#list-song").setAttribute("id", "suggested-" + video_id);
 | 
			
		||||
 
 | 
			
		||||
@@ -1652,7 +1652,13 @@ function addDynamicListeners() {
 | 
			
		||||
        var title 	= e.getAttribute("data-video-title");
 | 
			
		||||
        var length 	= e.getAttribute("data-video-length");
 | 
			
		||||
        var added_by = e.getAttribute("data-added-by");
 | 
			
		||||
        Search.submit(id, title, parseInt(length), false, 0, 1, 0, parseInt(length), "youtube");
 | 
			
		||||
        var source = "youtube";
 | 
			
		||||
        var thumbnail;
 | 
			
		||||
        if(e.getAttribute("data-video-source") != undefined) {
 | 
			
		||||
            source = "soundcloud";
 | 
			
		||||
            thumbnail = e.getAttribute("data-type-thumbnail");
 | 
			
		||||
        }
 | 
			
		||||
        Search.submit(id, title, parseInt(length), false, 0, 1, 0, parseInt(length), source, thumbnail);
 | 
			
		||||
        if(added_by == "user") {
 | 
			
		||||
            number_suggested = number_suggested - 1;
 | 
			
		||||
            if(number_suggested < 0) number_suggested = 0;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user