summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-06-11 12:48:36 -0700
committerBharat Mediratta <bharat@menalto.com>2009-06-11 12:48:36 -0700
commitae2fb806c7bebacc295cc3a3fe4cb78dd72c86b6 (patch)
tree54c2d65a35cc65686ee5dc97d240a576b5eaadba /modules
parent68fd196d66e2d21f571ff3b5a673f18cd129abf9 (diff)
Trap exceptions from movie::create() and mark those movies as corrupt.
Diffstat (limited to 'modules')
-rw-r--r--modules/g2_import/helpers/g2_import.php20
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 a6c21489..441c922a 100644
--- a/modules/g2_import/helpers/g2_import.php
+++ b/modules/g2_import/helpers/g2_import.php
@@ -425,13 +425,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;