mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Reorganized files and added script to convert old lists
This commit is contained in:
30
php/convert_lists.php
Normal file
30
php/convert_lists.php
Normal 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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user