mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Better way of deleting empty lists
This commit is contained in:
@@ -15,11 +15,11 @@ foreach($dir as $files){
|
|||||||
$time_lasted = time() - filemtime('./lists/'.$files);
|
$time_lasted = time() - filemtime('./lists/'.$files);
|
||||||
if($time_lasted > $to)
|
if($time_lasted > $to)
|
||||||
{
|
{
|
||||||
clearstatcache();
|
$file = file_get_contents('./lists/'.$files); //Checking if the channel has the setting for showing on the frontpage set to true.
|
||||||
$size = filesize('./lists/'.$files);
|
$data = json_decode($file, TRUE);
|
||||||
if($size < 200){
|
if(sizeof($data["songs"]) == 0)
|
||||||
|
{
|
||||||
unlink("./lists/".$files);
|
unlink("./lists/".$files);
|
||||||
$size;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($time_lasted < $time){
|
if($time_lasted < $time){
|
||||||
|
|||||||
Reference in New Issue
Block a user