Allow administrators to disable keeping the original. That's the new default!

This commit is contained in:
Christopher Allan Webber 2011-12-12 08:10:10 -06:00
parent ed1840ee64
commit 23caf305f2
2 changed files with 20 additions and 14 deletions

View File

@ -61,6 +61,11 @@ storage_class = string(default="mediagoblin.storage.filestorage:BasicFileStorage
base_dir = string(default="%(here)s/user_dev/media/queue")
# Should we keep the original file?
[media_type:mediagoblin.media_types.video]
keep_original = boolean(default=False)
[beaker.cache]
type = string(default="file")
data_dir = string(default="%(here)s/user_dev/beaker/cache/data")

View File

@ -41,6 +41,8 @@ def process_video(entry):
and attaches callbacks to that child process, hopefully, the
entry-complete callback will be called when the video is done.
"""
video_config = mgg.global_config['media_type:mediagoblin.media_types.video']
workbench = mgg.workbench_manager.create_workbench()
queued_filepath = entry['queued_media_file']
@ -94,7 +96,7 @@ def process_video(entry):
entry['media_files']['thumb'] = thumbnail_filepath
if video_config['keep_original']:
# Push original file to public storage
queued_file = file(queued_filename, 'rb')
@ -113,6 +115,5 @@ def process_video(entry):
mgg.queue_store.delete_file(queued_filepath)
# Save the MediaEntry
entry.save()