Reorganized files and added script to convert old lists

This commit is contained in:
Nicolas A. Tonne
2014-10-10 13:13:13 +02:00
parent 16f7a6328c
commit 086c999e51
16 changed files with 2858 additions and 1 deletions

30
php/convert_lists.php Normal file
View File

@@ -0,0 +1,30 @@
<?php
if(isset($_GET["pass"]) && $_GET["pass"]=="bæsj"){
include("change.php");
$dir = scandir('../lists');
$channels = array();
foreach($dir as $file){
if(strpos($file, '.json') !== FALSE){
$name='./lists/'.$file;
$data = json_decode(file_get_contents($name));
unlink($name);
checkFile($name); //should create a new file with correct stuff, in change
processList($data);
}
}
}else{
echo("kek");
}
function processList($list, $name){
foreach($list as $item){
//get id and title
addSong($name, $id, $title); //in change
}
}
?>