Permalink
Browse files

Added videoid parameter to postupload hook

  • Loading branch information...
1 parent c44d51c commit 348db4eebb94e2b76268c9b0333efe451a82662b @tomnomnom committed Mar 27, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 Scripts/UploadSingle.php
View
@@ -18,7 +18,7 @@
}
$filename = $argv[1];
-$executeHooks = function ($stage, $videoFile) use($log){
+$executeHooks = function ($stage, $videoFile, $videoId = null) use($log){
$returnValues = array();
$stage = ucFirst(strToLower($stage));
@@ -36,6 +36,9 @@
$log->info("Executing {$stage} hook [{$fullPath}]");
$cmd = $file->getPathname().' '.escapeshellarg($videoFile);
+ if ($videoId){
+ $cmd .= ' '.escapeshellarg($videoId);
+ }
exec($cmd, $output, $returnValue);
if ($returnValue != 0){
$log->warn("[{$fullPath}] had a non-zero return code for [{$videoFile}]");
@@ -131,6 +134,6 @@
}
// It worked if we got this far
-$executeHooks('Postupload', $filename);
+$executeHooks('Postupload', $filename, $videoId);
exit(0);

0 comments on commit 348db4e

Please sign in to comment.