Fix size detection of >10M files and add a toggle link to show/hide already download sings

This commit is contained in:
Némunaire 2012-10-31 21:09:35 +01:00
parent 5210a4d188
commit da8345eca6
3 changed files with 17 additions and 2 deletions

3
dl.sh
View File

@ -23,8 +23,9 @@ if [ ! -e /tmp/dlEnCours ]; then
echo "-- " >> $f.done echo "-- " >> $f.done
transmission-remote -AS transmission-remote -AS
else else
$pwd/youtube-dl --skip-download "$lign"
size=`$pwd/youtube-dl --skip-download "$lign" | grep "File size"` size=`$pwd/youtube-dl --skip-download "$lign" | grep "File size"`
if echo $size | grep -E " [1234]?[0-9]{2}\.[0-9]+M " if echo $size | grep -E " [1234]?[0-9]{1,2}\.[0-9]+M "
then then
echo "$lign" >> $pwd/database echo "$lign" >> $pwd/database

View File

@ -16,6 +16,14 @@ require(MAIN_DIR."/common.php");
<meta http-equiv="refresh" content="42"> <meta http-equiv="refresh" content="42">
</head> </head>
<body> <body>
<script type="text/javascript">
function toggleDiv(divname) {
if (document.getElementById(divname).className=="")
document.getElementById(divname).className="hidden";
else
document.getElementById(divname).className="";
}
</script>
<div class="blk"> <div class="blk">
<h2>Chansons prêtes à être téléchargées</h2> <h2>Chansons prêtes à être téléchargées</h2>
<div class="dled"><?php <div class="dled"><?php
@ -75,8 +83,10 @@ if (count($list_archives))
$ths = intval($m["dled"] / 21600); $ths = intval($m["dled"] / 21600);
if ($last < $ths) if ($last < $ths)
{ {
if ($last != 0)
echo "</div>";
$last = $ths; $last = $ths;
echo "<h4>".strftime("%a. %d %b %G - %H:%M", $m["dled"])."</h4>"; echo "<h4>".strftime("%a. %d %b %G - %H:%M", $m["dled"]).' <a href="javascript:toggleDiv(\'mus'.$m["dled"].'\')">Afficher&hellip;</a></h4><div class="hidden" id="mus'.$m["dled"].'">';
} }
format_clip($user, $m); format_clip($user, $m);
} }

View File

@ -194,3 +194,7 @@ div.clip:hover a.tp
{ {
display: block; display: block;
} }
div.hidden {
display: none;
}