ProcessingManager, request_from_args,
get_process_filename, store_public,
copy_original)
+from mediagoblin.processing.task import ProcessMedia
from mediagoblin.tools.translate import lazy_pass_to_ugettext as _
from mediagoblin.media_types import MissingComponents
self.add_processor(InitialProcessor)
self.add_processor(Resizer)
self.add_processor(Transcoder)
+
+ def workflow(self, entry, feed_url, reprocess_action, reprocess_info=None):
+ ProcessMedia().apply_async(
+ [entry.id, feed_url, reprocess_action, reprocess_info], {},
+ task_id=entry.queued_task_id)
return processor
- def workflow(self):
+ def workflow(self, entry, feed_url, reprocess_action, reprocess_info=None):
"""
Returns the Celery command needed to proceed with media processing
*This method has to be implemented in all media types*
from mediagoblin.tools.text import convert_to_tag_list_of_dicts
from mediagoblin.tools.federation import create_activity, create_generator
from mediagoblin.db.models import Collection, MediaEntry, ProcessingMetaData
-from mediagoblin.processing import mark_entry_failed
+from mediagoblin.processing import mark_entry_failed, get_entry_and_processing_manager
from mediagoblin.processing.task import ProcessMedia
from mediagoblin.notifications import add_comment_subscription
from mediagoblin.media_types import sniff_media
:param reprocess_action: What particular action should be run.
:param reprocess_info: A dict containing all of the necessary reprocessing
info for the given media_type"""
+
+ reprocess_info = reprocess_info or {}
+ entry, manager = get_entry_and_processing_manager(entry.id)
+
try:
- ProcessMedia().apply_async(
- [entry.id, feed_url, reprocess_action, reprocess_info], {},
- task_id=entry.queued_task_id)
+ manager.workflow(entry, feed_url, reprocess_action, reprocess_info)
except BaseException as exc:
# The purpose of this section is because when running in "lazy"
# or always-eager-with-exceptions-propagated celery mode that