1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00
This commit is contained in:
Daniel Neto 2024-09-20 14:01:50 -03:00
parent 25bb9cc324
commit e37a935dff

View file

@ -48,10 +48,23 @@ if (empty($_POST['list'])) {
$_POST['list'][] = $value['id']; $_POST['list'][] = $value['id'];
} }
} }
$o = new stdClass();
$o->savedPLItem = array();
$o->playlist_id = $_REQUEST['playlist_id'];
_error_log('playlistSort line='.__LINE__); _error_log('playlistSort line='.__LINE__);
mysqlBeginTransaction(); mysqlBeginTransaction();
foreach ($_POST['list'] as $key => $value) { foreach ($_POST['list'] as $key => $value) {
$result = $obj->addVideo($value, true, ($count++), false); if(empty($value)){
continue;
}
$order = ($count++);
$result = $obj->addVideo($value, true, $order, false);
$o->savedPLItem[] = array(
'resp'=>$result,
'videos_id'=>$value,
'order'=>$order,
);
} }
PlayList::deleteCacheDir($obj->getId()); PlayList::deleteCacheDir($obj->getId());
mysqlCommit(); mysqlCommit();
@ -62,7 +75,6 @@ if (!empty($_GET['sort'])) {
//header("Location: ". User::getChannelLink($obj->getUsers_id())); //header("Location: ". User::getChannelLink($obj->getUsers_id()));
exit; exit;
} }
$o = new stdClass();
$o->status = $result; $o->status = $result;
//$o->channelName = $obj->get; //$o->channelName = $obj->get;
echo json_encode($o);exit; echo json_encode($o);exit;