Index: flashvideo.module
===================================================================
--- flashvideo.module	(Revision 476)
+++ flashvideo.module	(Arbeitskopie)
@@ -704,7 +704,7 @@
 
   $timestamp = time();
 
-  if ((_flashvideo_get_filetype($oldfile->filepath) == 'flv' || _flashvideo_get_filetype($oldfile->filepath) == 'mp4') && !$create_thumbnail) {
+  if ((_flashvideo_get_filetype($oldfile->filepath) == 'flv' || _flashvideo_get_filetype($oldfile->filepath) == 'xxxmp4xxx') && !$create_thumbnail) {
     db_query("UPDATE {files} SET filepath='%s', filename='%s', filesize=%d WHERE fid=%d", $newfile->filepath, $newfile->filename, $newfile->filesize, $newfile->fid);
 
     // Insert this video into the flashvideo table if it is not already in there.
@@ -783,7 +783,7 @@
       // If we are not creating a thumbnail...
       if (!$create_thumbnail) {
         // If they wish to delete the original video...
-        if (flashvideo_variable_get($node_type, 'delete', 0) && (get_file_ext($oldfile->filepath) != 'flv' || get_file_ext($oldfile->filepath) != 'mp4')) {
+        if (flashvideo_variable_get($node_type, 'delete', 0) && (get_file_ext($oldfile->filepath) != 'flv' || get_file_ext($oldfile->filepath) != 'xxxmp4xxx')) {
           // Delete the original file from the file system.
           file_delete($oldfile->filepath);
 
@@ -983,8 +983,8 @@
     $newfile->filename = basename($file->filepath, '.'. $extension) .'_'. $file->fid;
 
     // Check for MP4
-    if ($extension == 'mp4')  {
-      $params['videoext'] = 'mp4';
+    if ($extension == 'xxxmp4xxx')  {
+      $params['videoext'] = 'xxxmp4xxx';
     }
 
     // Set the extension.
@@ -1037,7 +1037,7 @@
       // just copy the video to the output path and set the status to converted.  Otherwise, we will just
       // go ahead and try and convert the video.
 
-      if (!$create_thumbnail && ($extension == 'flv'|| $extension == 'mp4')) {
+      if (!$create_thumbnail && ($extension == 'flv'|| $extension == 'xxxmp4xxx')) {
         // Move the file to the output directory
         rename($filepath, $output_path);
       }
@@ -1531,7 +1531,10 @@
     $cck_finished_video_field_db_info = content_database_info($cck_finished_video_field);
     $cck_finished_thumbnail_field_db_info = content_database_info($cck_finished_thumbnail_field);
     // If they removed at least one file from the node...
+/*
     if (count($node->$cck_original_video_field['field_name']) < count($node->$cck_finished_video_field['field_name'])) {
+*/
+    if (empty($node->$cck_original_video_field['field_name']) || empty($node->$cck_original_video_field['field_name'][0])) {
       // Figure out which file(s) was removed.
       $removed_files = db_query("SELECT * FROM {flashvideo} WHERE fid NOT IN (SELECT fid FROM {files}) AND nid = %d", $node->nid);
       while ($removed_file = db_fetch_object($removed_files)) {
@@ -1808,7 +1811,10 @@
     if (count($fids) == 1) {
 
       // Find the thumbnail associated with this file ID.
+      /* Fucking ignorant morons!!!!!!!!!!!!!!!!
       $thumb_file = db_fetch_object(db_query("SELECT filepath,fid FROM {files} WHERE (fid = %d) AND (filemime='jpg')", $fids));
+      */
+      $thumb_file = db_fetch_object(db_query("SELECT filepath,fid FROM {files} WHERE (fid = %d)", $fids));
     }
   }
   else {
@@ -2063,7 +2069,7 @@
     // See if the filepath exists.
     $filepath = _flashvideo_get_filepath($filepath, $video['node_type']);
     // Only continue if they specify a video file.
-    if ($filepath && ($extension == 'flv'||$extension == 'mp4'))  {
+    if ($filepath && ($extension == 'flv'||$extension == 'xxxmp4xxx'))  {
       // Find the video file in the flashvideo table.
       $sql = "SELECT fv.oid, f.filepath, fv.width, fv.height, f.fid FROM {flashvideo} fv LEFT JOIN {files} f ON f.fid = fv.fid WHERE $flashmime AND (fv.status = %d) AND (f.filepath = '%s')";
       $video_file = db_fetch_object(db_query($sql, FLASHVIDEO_STATUS_CONVERTED, $filepath));
@@ -2175,7 +2181,7 @@
 function flashvideo_get_thumbnail_file($nid, $index) {
   $sql = "SELECT f.filepath,f.fid FROM {flashvideo} fv
       LEFT JOIN {files} f ON f.fid = fv.fid
-      WHERE (fv.nid = %d) AND (f.filemime='jpg') AND (fv.video_index=%d)";
+      WHERE (fv.nid = %d) AND (f.filemime IN ('jpg', 'image/png')) AND (fv.video_index=%d)";
   return db_fetch_object(db_query($sql, $nid, $index));
 }
 
@@ -2240,8 +2246,7 @@
 /**
  * Implementation of hook_nodeapi().
  */
-function flashvideo_nodeapi(&$node, $op, $teaser) {
-
+function flashvideo_nodeapi(&$node, $op, $teaser, $a4=NULL) {
   // Only if the node type is enabled.
   if (flashvideo_variable_get($node->type, 'enable', 0)) {
     switch ($op) {
