diff options
author | Evan Prodromou <evan@status.net> | 2010-01-10 13:25:16 -0800 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-01-10 13:25:16 -0800 |
commit | 2e42d3336af659ef76b2a9ade9cec099ba9ff521 (patch) | |
tree | 19cdfbb7e7c27b140373afe70d49638c871bf528 /classes/File_oembed.php | |
parent | f463329b9a5575856757ae8879e4cc11400d50a2 (diff) |
check before saving a thumbnail
Diffstat (limited to 'classes/File_oembed.php')
-rw-r--r-- | classes/File_oembed.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/classes/File_oembed.php b/classes/File_oembed.php index e41ccfd09..11f160718 100644 --- a/classes/File_oembed.php +++ b/classes/File_oembed.php @@ -115,7 +115,13 @@ class File_oembed extends Memcached_DataObject } $file_oembed->insert(); if (!empty($data->thumbnail_url)) { - File_thumbnail::saveNew($data, $file_id); + $ft = File_thumbnail::staticGet('file_id', $file_id); + if (!empty($ft)) { + common_log(LOG_WARNING, "Strangely, a File_thumbnail object exists for new file $file_id", + __FILE__); + } else { + File_thumbnail::saveNew($data, $file_id); + } } } } |