Allow administrators to disable keeping the original. That's the new default!
This commit is contained in:
parent
ed1840ee64
commit
23caf305f2
@ -61,6 +61,11 @@ storage_class = string(default="mediagoblin.storage.filestorage:BasicFileStorage
|
|||||||
base_dir = string(default="%(here)s/user_dev/media/queue")
|
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]
|
[beaker.cache]
|
||||||
type = string(default="file")
|
type = string(default="file")
|
||||||
data_dir = string(default="%(here)s/user_dev/beaker/cache/data")
|
data_dir = string(default="%(here)s/user_dev/beaker/cache/data")
|
||||||
|
@ -41,6 +41,8 @@ def process_video(entry):
|
|||||||
and attaches callbacks to that child process, hopefully, the
|
and attaches callbacks to that child process, hopefully, the
|
||||||
entry-complete callback will be called when the video is done.
|
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()
|
workbench = mgg.workbench_manager.create_workbench()
|
||||||
|
|
||||||
queued_filepath = entry['queued_media_file']
|
queued_filepath = entry['queued_media_file']
|
||||||
@ -94,7 +96,7 @@ def process_video(entry):
|
|||||||
|
|
||||||
entry['media_files']['thumb'] = thumbnail_filepath
|
entry['media_files']['thumb'] = thumbnail_filepath
|
||||||
|
|
||||||
|
if video_config['keep_original']:
|
||||||
# Push original file to public storage
|
# Push original file to public storage
|
||||||
queued_file = file(queued_filename, 'rb')
|
queued_file = file(queued_filename, 'rb')
|
||||||
|
|
||||||
@ -113,6 +115,5 @@ def process_video(entry):
|
|||||||
|
|
||||||
mgg.queue_store.delete_file(queued_filepath)
|
mgg.queue_store.delete_file(queued_filepath)
|
||||||
|
|
||||||
|
|
||||||
# Save the MediaEntry
|
# Save the MediaEntry
|
||||||
entry.save()
|
entry.save()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user