Add workflow method to other media ProcessingManagers
authorvijeth-aradhya <vijthaaa@gmail.com>
Sun, 4 Jun 2017 20:41:56 +0000 (02:11 +0530)
committervijeth-aradhya <vijthaaa@gmail.com>
Sun, 4 Jun 2017 20:41:56 +0000 (02:11 +0530)
Add workflow method to all the media types other than video.
Calls the old celery task as it is.

mediagoblin/media_types/ascii/processing.py
mediagoblin/media_types/audio/processing.py
mediagoblin/media_types/image/processing.py
mediagoblin/media_types/pdf/processing.py
mediagoblin/media_types/raw_image/processing.py
mediagoblin/media_types/stl/processing.py

index 00d04e63e657beb7abb92d630b9cefa7c2fd637d..71ccc86ef07b406ea013f035b0a9b36c67bf87ed 100644 (file)
@@ -273,3 +273,8 @@ class AsciiProcessingManager(ProcessingManager):
         super(AsciiProcessingManager, self).__init__()
         self.add_processor(InitialProcessor)
         self.add_processor(Resizer)
+
+    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)
index 427309de5f212cdf9d34789c68b0ea6db4e01363..a83d60f750539000d372e5cdb892a713032b6cb1 100644 (file)
@@ -365,3 +365,8 @@ class AudioProcessingManager(ProcessingManager):
         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)
index 14091d6ec16a89a0dae3b4ecb97579fbf129d7d1..42234eff12288c778e2974a92203bdf3e6313888 100644 (file)
@@ -431,6 +431,12 @@ class ImageProcessingManager(ProcessingManager):
         self.add_processor(Resizer)
         self.add_processor(MetadataProcessing)
 
+    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)
+
+
 if __name__ == '__main__':
     import sys
     import pprint
index ac4bab6d55a51a39594d9fabd9d6a472c9ccc8ff..d93b19bb70c8fcf29156e29df0e2f123ed6d6202 100644 (file)
@@ -470,3 +470,8 @@ class PdfProcessingManager(ProcessingManager):
         super(PdfProcessingManager, self).__init__()
         self.add_processor(InitialProcessor)
         self.add_processor(Resizer)
+
+    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)
index 740ba2ddaa25b97c52f66231b4f84a1da61cb178..a385d563b7294beec5cb4f8017b9168645368801 100644 (file)
@@ -80,3 +80,8 @@ class RawImageProcessingManager(ProcessingManager):
         super(RawImageProcessingManager, self).__init__()
         self.add_processor(InitialRawProcessor)
         self.add_processor(Resizer)
+
+    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)
index 55764aeb2454047af51b56d0c969f70b6ff270a2..7f2f350d41a872ac51dce1a290c810b1f3d8fcca 100644 (file)
@@ -368,3 +368,8 @@ class StlProcessingManager(ProcessingManager):
         super(StlProcessingManager, self).__init__()
         self.add_processor(InitialProcessor)
         self.add_processor(Resizer)
+
+    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)