Removed limit on number of songs allowed in imported playlist

This commit is contained in:
Kasper Rynning-Tønnesen
2015-07-13 09:55:21 +02:00
parent 14c26edb97
commit b6f95200cf
3 changed files with 9 additions and 5 deletions

View File

@@ -646,7 +646,7 @@ function change_song_post(coll)
{$match:{now_playing:false}},
{$sort:{votes:-1, added:1}},
{$limit:1}], function(err, docs){
if(docs !== null && docs.length > 0){
if(docs !== null && docs.length > 0){
db.collection(coll).update({id:docs[0]["id"]},
{$set:{
now_playing:true,

File diff suppressed because one or more lines are too long

View File

@@ -125,8 +125,11 @@ var Search = {
$(".main").removeClass("clickthrough");
},
importPlaylist: function(pId){
playlist_url = "https://www.googleapis.com/youtube/v3/playlistItems?part=contentDetails&maxResults=49&key="+api_key+"&playlistId="+pId;
importPlaylist: function(pId,pageToken){
token = "";
if(pageToken !== undefined)
token = "&pageToken="+pageToken;
playlist_url = "https://www.googleapis.com/youtube/v3/playlistItems?part=contentDetails&maxResults=49&key="+api_key+"&playlistId="+pId+token;
$.ajax({
type: "GET",
url: playlist_url,
@@ -139,6 +142,7 @@ var Search = {
ids+=data.contentDetails.videoId+",";
});
Search.addVideos(ids);
if(response.nextPageToken) Search.importPlaylist(pId, response.nextPageToken);
document.getElementById("import").value = "";
}
});