From d3390c4391f18f4f1ac76557a98b106452baf295 Mon Sep 17 00:00:00 2001 From: vijeth-aradhya Date: Sun, 4 Jun 2017 23:45:18 +0530 Subject: Add workflow method to ProcessingManager This method just raises NotImplementedError if the specific media processing manager does not have a workflow method. --- mediagoblin/processing/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mediagoblin/processing') diff --git a/mediagoblin/processing/__init__.py b/mediagoblin/processing/__init__.py index 29345227..7e05b242 100644 --- a/mediagoblin/processing/__init__.py +++ b/mediagoblin/processing/__init__.py @@ -257,6 +257,13 @@ class ProcessingManager(object): return processor + def workflow(self): + """ + Returns the Celery command needed to proceed with media processing + *This method has to be implemented in all media types* + """ + raise NotImplementedError + def request_from_args(args, which_args): """ -- cgit v1.2.3 From 81c59ef06b1e53fa0d9b177b5a8e7978d1b01186 Mon Sep 17 00:00:00 2001 From: vijeth-aradhya Date: Mon, 5 Jun 2017 01:58:00 +0530 Subject: Add workflow method to VideoProcessingManager This commit makes sure the old celery call works perfectly when workflow method is introduced. --- mediagoblin/processing/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mediagoblin/processing') diff --git a/mediagoblin/processing/__init__.py b/mediagoblin/processing/__init__.py index 7e05b242..4e5853c1 100644 --- a/mediagoblin/processing/__init__.py +++ b/mediagoblin/processing/__init__.py @@ -257,7 +257,7 @@ class ProcessingManager(object): 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* -- cgit v1.2.3 From 25ecdec9971394064063db397232eb7f0e89fae3 Mon Sep 17 00:00:00 2001 From: vijeth-aradhya Date: Mon, 12 Jun 2017 20:53:23 +0530 Subject: Add priority to the celery tasks Few more changes to be made before executing the tasks. Also #1 should be handled soon after this. --- mediagoblin/processing/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mediagoblin/processing') diff --git a/mediagoblin/processing/__init__.py b/mediagoblin/processing/__init__.py index 4e5853c1..76f81faa 100644 --- a/mediagoblin/processing/__init__.py +++ b/mediagoblin/processing/__init__.py @@ -257,7 +257,8 @@ class ProcessingManager(object): return processor - def workflow(self, entry, feed_url, reprocess_action, reprocess_info=None): + def workflow(self, entry, manager, 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* -- cgit v1.2.3 From d77eb56280f57e547294e29e6a1b2b4d46c15ac6 Mon Sep 17 00:00:00 2001 From: vijeth-aradhya Date: Tue, 13 Jun 2017 01:43:43 +0530 Subject: Celery Priority testing with debug statements Error at this line: `self.entry.set_file_metadata(self.curr_file, **file_metadata)` Otherwise, celery part should work fine. --- mediagoblin/processing/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'mediagoblin/processing') diff --git a/mediagoblin/processing/__init__.py b/mediagoblin/processing/__init__.py index 76f81faa..98031bbc 100644 --- a/mediagoblin/processing/__init__.py +++ b/mediagoblin/processing/__init__.py @@ -257,8 +257,7 @@ class ProcessingManager(object): return processor - def workflow(self, entry, manager, feed_url, reprocess_action, - reprocess_info=None): + def workflow(self, entry_id, 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* -- cgit v1.2.3 From 33d5ac6c4de44aa8d98a8cf759c79351f5a59885 Mon Sep 17 00:00:00 2001 From: vijeth-aradhya Date: Sat, 17 Jun 2017 00:53:39 +0530 Subject: Simple hack to handle main workflow problem Remove redundunt workflow methods from the other media type's processing.py. Fixes #1 --- mediagoblin/processing/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'mediagoblin/processing') diff --git a/mediagoblin/processing/__init__.py b/mediagoblin/processing/__init__.py index 98031bbc..7d407a36 100644 --- a/mediagoblin/processing/__init__.py +++ b/mediagoblin/processing/__init__.py @@ -257,12 +257,11 @@ class ProcessingManager(object): return processor - def workflow(self, entry_id, feed_url, reprocess_action, reprocess_info=None): + 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* """ - raise NotImplementedError + return None def request_from_args(args, which_args): -- cgit v1.2.3 From 3456abe90196d5894fc5f8aa0383d02b894b1f2d Mon Sep 17 00:00:00 2001 From: vijeth-aradhya Date: Thu, 10 Aug 2017 19:32:29 +0530 Subject: Fix percentage reporting Report transcoding_progress as the overall percent of all resolutions. Modify Logging. Closes #6 --- mediagoblin/processing/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mediagoblin/processing') diff --git a/mediagoblin/processing/__init__.py b/mediagoblin/processing/__init__.py index 7d407a36..a9d5442b 100644 --- a/mediagoblin/processing/__init__.py +++ b/mediagoblin/processing/__init__.py @@ -41,7 +41,10 @@ class ProgressCallback(object): def __call__(self, progress): if progress: - self.entry.transcoding_progress = progress + if 100 - (self.entry.transcoding_progress + progress) < 0.01: + self.entry.transcoding_progress = 100 + else: + self.entry.transcoding_progress += progress self.entry.save() -- cgit v1.2.3 From b89e12a23e55e0a1a4750e3107b114f27a0f0382 Mon Sep 17 00:00:00 2001 From: vijeth-aradhya Date: Tue, 22 Aug 2017 13:30:13 +0530 Subject: Add main_transcoding_progress to ProgressCallback --- mediagoblin/processing/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mediagoblin/processing') diff --git a/mediagoblin/processing/__init__.py b/mediagoblin/processing/__init__.py index a9d5442b..2897b5e7 100644 --- a/mediagoblin/processing/__init__.py +++ b/mediagoblin/processing/__init__.py @@ -39,12 +39,14 @@ class ProgressCallback(object): def __init__(self, entry): self.entry = entry - def __call__(self, progress): + def __call__(self, progress, default_quality_progress=None): if progress: if 100 - (self.entry.transcoding_progress + progress) < 0.01: self.entry.transcoding_progress = 100 else: - self.entry.transcoding_progress += progress + self.entry.transcoding_progress += round(progress, 2) + if default_quality_progress: + self.entry.main_transcoding_progress = default_quality_progress self.entry.save() -- cgit v1.2.3