Convert media processing backends to delete the queue directory (#254)
[mediagoblin.git] / mediagoblin / media_types / video / processing.py
index 4c9f01319edff3ec688b3a8e095b0f39145e826e..68d14148af97aa281fd5f6ed4796cda2548e960d 100644 (file)
@@ -121,4 +121,10 @@ def process_video(entry, workbench=None):
         mgg.public_store.copy_local_to_storage(queued_filename, original_filepath)
         entry.media_files['original'] = original_filepath
 
-    mgg.queue_store.delete_file(queued_filepath)
+    # Remove queued media file from storage and database.
+    # queued_filepath is in the task_id directory which should
+    # be removed too, but fail if the directory is not empty to be on
+    # the super-safe side.
+    mgg.queue_store.delete_file(queued_filepath)      # rm file
+    mgg.queue_store.delete_dir(queued_filepath[:-1])  # rm dir
+    entry.queued_media_file = []