[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?>");
@ -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']);
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(