mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Removed limit on number of songs allowed in imported playlist
This commit is contained in:
@@ -646,7 +646,7 @@ function change_song_post(coll)
|
|||||||
{$match:{now_playing:false}},
|
{$match:{now_playing:false}},
|
||||||
{$sort:{votes:-1, added:1}},
|
{$sort:{votes:-1, added:1}},
|
||||||
{$limit:1}], function(err, docs){
|
{$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"]},
|
db.collection(coll).update({id:docs[0]["id"]},
|
||||||
{$set:{
|
{$set:{
|
||||||
now_playing:true,
|
now_playing:true,
|
||||||
|
|||||||
4
static/dist/main.min.js
vendored
4
static/dist/main.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -125,8 +125,11 @@ var Search = {
|
|||||||
$(".main").removeClass("clickthrough");
|
$(".main").removeClass("clickthrough");
|
||||||
},
|
},
|
||||||
|
|
||||||
importPlaylist: function(pId){
|
importPlaylist: function(pId,pageToken){
|
||||||
playlist_url = "https://www.googleapis.com/youtube/v3/playlistItems?part=contentDetails&maxResults=49&key="+api_key+"&playlistId="+pId;
|
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({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: playlist_url,
|
url: playlist_url,
|
||||||
@@ -139,6 +142,7 @@ var Search = {
|
|||||||
ids+=data.contentDetails.videoId+",";
|
ids+=data.contentDetails.videoId+",";
|
||||||
});
|
});
|
||||||
Search.addVideos(ids);
|
Search.addVideos(ids);
|
||||||
|
if(response.nextPageToken) Search.importPlaylist(pId, response.nextPageToken);
|
||||||
document.getElementById("import").value = "";
|
document.getElementById("import").value = "";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user