diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-06-12 03:48:36 +0800 |
---|---|---|
committer | <unostar@danalan.info> | 2009-06-12 06:55:16 +0800 |
commit | 1d60d8ee46ab0631f628d58e3196276117ad52a4 (patch) | |
tree | e260fd92ad5241232d8302c86cec2de9b7c0bc56 | |
parent | dfa7ec6b0be19a3c03f6bc2f8f09117c1535d37d (diff) |
Trap exceptions from movie::create() and mark those movies as corrupt.
Signed-off-by: <unostar@danalan.info>
-rw-r--r-- | modules/g2_import/helpers/g2_import.php | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 01e07eba..33cfc158 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -432,13 +432,19 @@ class g2_import_Core { case "GalleryMovieItem": // @todo we should transcode other types into FLV if (in_array($g2_item->getMimeType(), array("video/mp4", "video/x-flv"))) { - $item = movie::create( - $parent, - $g2_path, - $g2_item->getPathComponent(), - $g2_item->getTitle(), - self::extract_description($g2_item), - self::map($g2_item->getOwnerId())); + try { + $item = movie::create( + $parent, + $g2_path, + $g2_item->getPathComponent(), + $g2_item->getTitle(), + self::extract_description($g2_item), + self::map($g2_item->getOwnerId())); + } catch (Exception $e) { + Kohana::log("alert", "Corrupt movie $g2_path\n" . + $e->getMessage() . "\n" . $e->getTraceAsString()); + $corrupt = 1; + } } break; |