mirror of
https://github.com/friendica/friendica
synced 2025-04-24 01:50:17 +00:00
Avoid some database errors
This commit is contained in:
parent
4e3102bfb3
commit
15d975f143
3 changed files with 5 additions and 2 deletions
|
@ -85,6 +85,7 @@ class Media
|
|||
}
|
||||
|
||||
$media = self::unsetEmptyFields($media);
|
||||
$media = DI::dbaDefinition()->truncateFieldsForTable('post-media', $media);
|
||||
|
||||
// We are storing as fast as possible to avoid duplicated network requests
|
||||
// when fetching additional information for pictures and other content.
|
||||
|
@ -94,6 +95,7 @@ class Media
|
|||
|
||||
$media = self::fetchAdditionalData($media);
|
||||
$media = self::unsetEmptyFields($media);
|
||||
$media = DI::dbaDefinition()->truncateFieldsForTable('post-media', $media);
|
||||
|
||||
if (array_diff_assoc($media, $stored)) {
|
||||
$result = DBA::insert('post-media', $media, Database::INSERT_UPDATE);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue