mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00
This commit is contained in:
parent
f1d5628010
commit
f702770262
1 changed files with 73 additions and 67 deletions
|
@ -36,6 +36,7 @@ if (!$video2->userCanManageVideo()) {
|
||||||
die(json_encode($obj));
|
die(json_encode($obj));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_error_log("Swap videos START: " . $video1->getId() . " with " . $video2->getId());
|
||||||
$video1Filename = $video1->getFilename();
|
$video1Filename = $video1->getFilename();
|
||||||
$video1Sites_id = $video1->getSites_id();
|
$video1Sites_id = $video1->getSites_id();
|
||||||
$video1Duration = $video1->getDuration();
|
$video1Duration = $video1->getDuration();
|
||||||
|
@ -53,15 +54,20 @@ $video2->setSites_id($video1Sites_id);
|
||||||
$video2->setDuration($video1Duration);
|
$video2->setDuration($video1Duration);
|
||||||
mysqlBeginTransaction();
|
mysqlBeginTransaction();
|
||||||
if (!$video1->save()) {
|
if (!$video1->save()) {
|
||||||
$obj->msg = __("Error on save video 1");
|
$obj->msg = __("Error on swap video 1");
|
||||||
|
_error_log($obj->msg);
|
||||||
die(json_encode($obj));
|
die(json_encode($obj));
|
||||||
}
|
}
|
||||||
|
_error_log("Swap videos1 SUCCESS: " . $video1->getId());
|
||||||
if (!$video2->save()) {
|
if (!$video2->save()) {
|
||||||
$obj->msg = __("Error on save video 2");
|
$obj->msg = __("Error on swap video 2");
|
||||||
|
_error_log($obj->msg);
|
||||||
die(json_encode($obj));
|
die(json_encode($obj));
|
||||||
}
|
}
|
||||||
|
_error_log("Swap videos2 SUCCESS: " . $video2->getId());
|
||||||
$video1->setVideoHigestResolution(0);
|
$video1->setVideoHigestResolution(0);
|
||||||
$video2->setVideoHigestResolution(0);
|
$video2->setVideoHigestResolution(0);
|
||||||
mysqlCommit();
|
mysqlCommit();
|
||||||
|
_error_log("Swap videos END: " . $video1->getId() . " with " . $video2->getId());
|
||||||
$obj->error = false;
|
$obj->error = false;
|
||||||
die(json_encode($obj));
|
die(json_encode($obj));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue