--- flashvideo.module.cvs 2008-11-22 14:56:28.000000000 +0000 +++ flashvideo.module 2008-11-22 14:59:40.000000000 +0000 @@ -1059,7 +1059,18 @@ function _flashvideo_perform_postop($old db_query("DELETE FROM {flashvideo} WHERE fid=%d", $oldfile->fid); // Delete the file from the flashvideo table. module_invoke_all('flashvideo_delete_file', $oldfile); } - + + if( flashvideo_variable_get($node_type, 'originaldir',0) != '' ) { + $originaldir=flashvideo_variable_get($node_type, 'originaldir',0); + $original_path = $useroot ? $originaldir : file_directory_path() . '/' . $originaldir; + file_check_directory($original_path, 1); + $original_path .= '/' . basename($oldfile->filepath); + rename(getcwd() . '/' . $oldfile->filepath, getcwd() . '/' . $original_path); + $oldfile->filepath = $original_path; + db_query("UPDATE {files} SET filepath='%s' WHERE fid=%d", $original_path, $oldfile->fid); // Change the filepath in the files table. + module_invoke_all('flashvideo_save_file', $oldfile); + } + $timestamp = time(); db_query("INSERT INTO {ffmpeg_data} (fid, created, input_file, output_file, status) VALUES (%d, $timestamp, '%s', '%s', %d)", $oldfile->fid, $oldfile->filepath, $newfile->filepath, 1); @@ -1245,16 +1256,7 @@ function flashvideo_convert($file, $node if(file_exists($output_path) && filesize($output_path) > 0) { // Check to make sure the new file exists. $newfile->filemime = $create_thumbnail ? $params['thumbext'] : $params['videomime']; // Get the new file mimetype $newfile->filesize = filesize($output_path); // Get the new file size. - - if(!$create_thumbnail && $params['originaldir'] != '' && $extension != 'flv') { - $original_path = $useroot ? $params['originaldir'] : file_directory_path() . '/' . $params['originaldir']; - file_check_directory($original_path, 1); - $original_path .= '/' . basename($file->filepath); - rename(getcwd() . '/' . $file->filepath, getcwd() . '/' . $original_path); - $file->filepath = $original_path; - db_query("UPDATE {files} SET filepath='%s' WHERE fid=%d", $original_path, $file->fid); // Change the filepath in the files table. - } - + _flashvideo_perform_postop($file, $newfile, $node_type, $create_thumbnail); // Sucess! Perform the Post Operations. return TRUE; // Return TRUE upon success. }