mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
This commit is contained in:
parent
97a9e25735
commit
986d113beb
3 changed files with 6 additions and 2 deletions
|
@ -356,7 +356,7 @@ abstract class ObjectYPT implements ObjectInterface
|
|||
foreach ($fieldsName as $value) {
|
||||
if (is_string($value) && (strtolower($value) == 'created' || strtolower($value) == 'modified')) {
|
||||
if (strtolower($value) == 'created') {
|
||||
if (empty($this->created) || (!User::isAdmin() && !isCommandLineInterface())) {
|
||||
if (empty($this->created) || (!User::isAdmin() && !isCommandLineInterface() && empty($global['allowModifyCreated']))) {
|
||||
$fields[] = " now() ";
|
||||
} else {
|
||||
$this->created = preg_replace('/[^0-9: \/-]/', '', $this->created);
|
||||
|
@ -399,7 +399,7 @@ abstract class ObjectYPT implements ObjectInterface
|
|||
$sql .= " VALUES (" . implode(", ", $fields) . ")";
|
||||
}
|
||||
//error_log("save: $sql [$formats]".json_encode($values));
|
||||
//var_dump(static::getTableName(), $sql, $values);
|
||||
//var_dump(static::getTableName(), $sql, $values);exit;
|
||||
//if(static::getTableName() == 'videos'){ echo $sql;var_dump($values); var_dump(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS));}//return false;
|
||||
//echo $sql;var_dump($this, $values, $global['mysqli']->error);exit;
|
||||
$global['lastQuery'] = array('sql'=>$sql, 'formats'=>$formats, 'values'=>$values );
|
||||
|
|
|
@ -231,6 +231,7 @@ if (!class_exists('Video')) {
|
|||
public function setCreated($created): void
|
||||
{
|
||||
$this->created = convertToMySQLDate($created);
|
||||
_error_log("created date set from {$created} to {$this->created}");
|
||||
}
|
||||
|
||||
function getUsers_id_company(): int
|
||||
|
|
|
@ -82,8 +82,11 @@ if(!BulkEmbed::canBulkEmbed()){
|
|||
|
||||
// Set the original video date if available in the form data
|
||||
if (!empty($value['date']) && $objo->useOriginalYoutubeDate) {
|
||||
//_error_log("Do save original date");
|
||||
$global['allowModifyCreated'] = 1;
|
||||
$videos->setCreated($value['date']); // Set the original creation date of the video
|
||||
}else{
|
||||
//_error_log("Do not save original date");
|
||||
}
|
||||
|
||||
$poster = Video::getPathToFile("{$paths['filename']}.jpg");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue