[fix] bad path when adding video or import dir

This commit is contained in:
Knah Tsaeb 2013-08-21 09:13:22 +02:00
parent da45a53134
commit edb84ae6b4
2 changed files with 9 additions and 5 deletions

View File

@ -26,7 +26,7 @@ do
then
rm $file
sleep 1
mv $urlHash* $finalDest$destination
mv $urlHash* $destination
fi
done < $file
fi

View File

@ -239,7 +239,7 @@ function importDir($bc, $fullListDir, $fullListFile) {
'uploadDateSort' => $value['uploadDateSort']
);
$url = escapeshellcmd($value['url']);
$data = $key.' '.$url.' '.$_SERVER['DOCUMENT_ROOT'].'/'.$GLOBALS['config']['VIDEODIR'].'/'.$path.$file['hash']."\n";
$data = $key.' '.$url.' '.$_SERVER['DOCUMENT_ROOT'].'/'.$GLOBALS['config']['VIDEODIR'].'/'.$path.$file['hash'].'/'."\n";
file_put_contents($GLOBALS['config']['TMPDIR'].'/'.$key.'.hash', $data);
}
file_put_contents($GLOBALS['config']['LISTFILE'], "<?php\n\$fullListFile=".var_export($fullListFile, true).";\n?>");
@ -285,9 +285,9 @@ function n_print($data, $name = '') {
<fieldset style="border: 1px solid orange; padding: 5px;color:#1E1915; background-color: #fff;">';
echo '
<legend style="border:1px solid orange;padding: 1px;background-color:#eee;color:orange;">
', basename($aBackTrace[0]['file']), ' ligne => ', $aBackTrace[0]['line'], '
', basename($aBackTrace[0]['file']), ' ligne => ', $aBackTrace[0]['line'], '
</legend>';
echo '<pre style="color:#1E1915;">', htmlentities(print_r($data, 1)), '</pre>';
echo '<pre style="color:#1E1915;">', htmlentities(print_r($data, 1)), '</pre>';
echo '
</fieldset>
<br />';
@ -352,7 +352,11 @@ function removeDir($dir, $fullListDir) {
function addVideo($ci, $fullListFile) {
$nameHash = substr(sha1($ci['name'].$ci['url']), 0, 10);
$url = escapeshellcmd($ci['url']);
$path = chunk_split($ci['bc'], 8, '/');
if (!empty($ci['bc'])) {
$path = chunk_split($ci['bc'], 8, '/');
} else {
$path = '';
}
$data = $nameHash.' '.$url.' '.$_SERVER['DOCUMENT_ROOT'].'/'.$GLOBALS['config']['VIDEODIR'].'/'.$path."\n";
file_put_contents($GLOBALS['config']['TMPDIR'].'/'.$nameHash.'.hash', $data);
$fullListFile[$nameHash] = array(