Refactor video processing to use FilenameMunger.
This commit is contained in:
parent
ab35ad4605
commit
84725abd64
@ -20,7 +20,7 @@ import os
|
||||
|
||||
from mediagoblin import mg_globals as mgg
|
||||
from mediagoblin.processing import mark_entry_failed, \
|
||||
THUMB_SIZE, MEDIUM_SIZE, create_pub_filepath
|
||||
THUMB_SIZE, MEDIUM_SIZE, create_pub_filepath, FilenameMunger
|
||||
from . import transcoders
|
||||
|
||||
logging.basicConfig()
|
||||
@ -49,17 +49,13 @@ def process_video(entry):
|
||||
queued_filename = workbench.localized_file(
|
||||
mgg.queue_store, queued_filepath,
|
||||
'source')
|
||||
name_munger = FilenameMunger(queued_filename)
|
||||
|
||||
medium_filepath = create_pub_filepath(
|
||||
entry,
|
||||
'{original}-640p.webm'.format(
|
||||
original=os.path.splitext(
|
||||
queued_filepath[-1])[0] # Select the
|
||||
))
|
||||
entry, name_munger.munge('{basename}-640p.webm'))
|
||||
|
||||
thumbnail_filepath = create_pub_filepath(
|
||||
entry, 'thumbnail.jpg')
|
||||
|
||||
entry, name_munger.munge('{basename}.thumbnail.jpg'))
|
||||
|
||||
# Create a temporary file for the video destination
|
||||
tmp_dst = tempfile.NamedTemporaryFile()
|
||||
|
Loading…
x
Reference in New Issue
Block a user