mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Test for song import
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
<?php
|
||||
|
||||
$guid=substr(base64_encode(crc32($_SERVER['HTTP_USER_AGENT'].$_SERVER['REMOTE_ADDR'].$_SERVER['HTTP_ACCEPT_LANGUAGE'])), 0, 8);
|
||||
if(isset($_GET['chan'])) {header('Location: '.$_GET['chan']); exit;}
|
||||
$list = explode("/", htmlspecialchars(strtolower($_SERVER["REQUEST_URI"])));
|
||||
if($list[1]==""||!isset($list[1])||count($list)<=1){$list="";include('php/nochan.php');die();}
|
||||
else $list=$list[1];
|
||||
|
||||
|
||||
?>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#">
|
||||
<head>
|
||||
|
||||
@@ -124,6 +124,25 @@ function skip(){
|
||||
return true;
|
||||
}
|
||||
|
||||
function importOldList(chan){
|
||||
playlist_url = "http://zoff.no/"+chan+"/php/change.php";
|
||||
|
||||
list = $.ajax({
|
||||
type: "GET",
|
||||
url: playlist_url,
|
||||
async: false
|
||||
}).responseText;
|
||||
list = $.parseJSON(list);
|
||||
var ids="";
|
||||
$.each(list.songs, function(i,data)
|
||||
{
|
||||
ids+=data.id+",";
|
||||
if(i>48)return;
|
||||
});
|
||||
addVideos(ids);
|
||||
document.getElementById("search").value = "";
|
||||
}
|
||||
|
||||
function refresh_scroll()
|
||||
{
|
||||
myScroll.refresh();
|
||||
|
||||
@@ -14,10 +14,9 @@ function getCookie(cname) {
|
||||
function populate_channels(lists)
|
||||
{
|
||||
var output = "";
|
||||
|
||||
var num = 0;
|
||||
lists.sort(sortFunction);
|
||||
|
||||
|
||||
pre_card = $(list_html);
|
||||
|
||||
for(x in lists)
|
||||
@@ -45,6 +44,8 @@ function populate_channels(lists)
|
||||
console.log(chan);
|
||||
|
||||
output+="<option value='"+chan+"'> ";
|
||||
num++;
|
||||
if(num>19)break;
|
||||
}
|
||||
document.getElementById("searches").innerHTML = output;
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ socket.on(chan.toLowerCase()+",np", function(obj)
|
||||
if(obj[0].length == 0){
|
||||
console.log("Empty list");
|
||||
document.getElementById('song-title').innerHTML = "Empty channel. Add some songs!"
|
||||
importOldList(chan.toLowerCase());
|
||||
}
|
||||
else{
|
||||
console.log("gotten new song");
|
||||
|
||||
Reference in New Issue
Block a user