From 9eabae58420ecb3cc289d6d7ff4c2414f9c63370 Mon Sep 17 00:00:00 2001 From: Minteck Date: Sun, 31 Oct 2021 12:30:56 +0100 Subject: Initial commit --- index.php | 447 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 447 insertions(+) create mode 100644 index.php (limited to 'index.php') diff --git a/index.php b/index.php new file mode 100644 index 0000000..be4083a --- /dev/null +++ b/index.php @@ -0,0 +1,447 @@ + + + + +
+ + + +
+ +
+ + analyze($file); + + if (isset($id3["playtime_string"])) { + $str = $id3["playtime_string"]; + $str2 = (int)round($id3["playtime_seconds"]); + } else { + $str = "-:--"; + $str2 = 0; + } + + $times[$afile] = [ + "duration" => $str, + "seconds" => $str2, + "date" => $date + ]; + array_push($times["@items"], $afile); + + return $str; + } + } + + function cmp_by_date($a, $b) { + return $a["date"] <=> $b["date"]; + } + + $list = scandir($_SERVER['DOCUMENT_ROOT'] . "/data/films/metadata"); + $films = []; + + foreach ($list as $item) { + if ($item !== "." && $item !== "..") { + $films[substr($item, 0, -5)] = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/films/metadata/" . $item), true); + $films[substr($item, 0, -5)]["id"] = substr($item, 0, -5); + } + } + + usort($films, function ($a, $b) { + return $a['date'] <=> $b['date']; + }); + + $films = array_reverse($films); + + $seconds = 0; + foreach ($times as $titem => $tdata) { + if ($titem !== "@items") { + $seconds = $seconds + $tdata["seconds"]; + } + } + + $secstr = $seconds . " secondes"; + if ($seconds > 60) { + $secstr = round($seconds / 60) . " minutes"; + if ($seconds > 3600) { + $secstr = round($seconds / 3600) . " heures"; + } + } + + ?> + +

vidéos, de contenu

+ + + + +
+ + + + -- cgit