[fix] bad path when adding video or import dir
This commit is contained in:
parent
da45a53134
commit
edb84ae6b4
|
@ -26,7 +26,7 @@ do
|
||||||
then
|
then
|
||||||
rm $file
|
rm $file
|
||||||
sleep 1
|
sleep 1
|
||||||
mv $urlHash* $finalDest$destination
|
mv $urlHash* $destination
|
||||||
fi
|
fi
|
||||||
done < $file
|
done < $file
|
||||||
fi
|
fi
|
||||||
|
|
12
index.php
12
index.php
|
@ -239,7 +239,7 @@ function importDir($bc, $fullListDir, $fullListFile) {
|
||||||
'uploadDateSort' => $value['uploadDateSort']
|
'uploadDateSort' => $value['uploadDateSort']
|
||||||
);
|
);
|
||||||
$url = escapeshellcmd($value['url']);
|
$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']['TMPDIR'].'/'.$key.'.hash', $data);
|
||||||
}
|
}
|
||||||
file_put_contents($GLOBALS['config']['LISTFILE'], "<?php\n\$fullListFile=".var_export($fullListFile, true).";\n?>");
|
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;">';
|
<fieldset style="border: 1px solid orange; padding: 5px;color:#1E1915; background-color: #fff;">';
|
||||||
echo '
|
echo '
|
||||||
<legend style="border:1px solid orange;padding: 1px;background-color:#eee;color:orange;">
|
<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>';
|
</legend>';
|
||||||
echo '<pre style="color:#1E1915;">', htmlentities(print_r($data, 1)), '</pre>';
|
echo '<pre style="color:#1E1915;">', htmlentities(print_r($data, 1)), '</pre>';
|
||||||
echo '
|
echo '
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<br />';
|
<br />';
|
||||||
|
@ -352,7 +352,11 @@ function removeDir($dir, $fullListDir) {
|
||||||
function addVideo($ci, $fullListFile) {
|
function addVideo($ci, $fullListFile) {
|
||||||
$nameHash = substr(sha1($ci['name'].$ci['url']), 0, 10);
|
$nameHash = substr(sha1($ci['name'].$ci['url']), 0, 10);
|
||||||
$url = escapeshellcmd($ci['url']);
|
$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";
|
$data = $nameHash.' '.$url.' '.$_SERVER['DOCUMENT_ROOT'].'/'.$GLOBALS['config']['VIDEODIR'].'/'.$path."\n";
|
||||||
file_put_contents($GLOBALS['config']['TMPDIR'].'/'.$nameHash.'.hash', $data);
|
file_put_contents($GLOBALS['config']['TMPDIR'].'/'.$nameHash.'.hash', $data);
|
||||||
$fullListFile[$nameHash] = array(
|
$fullListFile[$nameHash] = array(
|
||||||
|
|
Loading…
Reference in a new issue