From 6b9ee0ca13b99ee20f9d0c680a950c6a7494a5a0 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sun, 24 Jul 2011 23:12:46 -0500 Subject: Store the task id of a processing action in the database. --- mediagoblin/db/models.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'mediagoblin/db/models.py') diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py index bad15aca..e97dc537 100644 --- a/mediagoblin/db/models.py +++ b/mediagoblin/db/models.py @@ -162,6 +162,8 @@ class MediaEntry(Document): queued for processing. This is stored in the mg_globals.queue_store storage system. + - queued_task_id: celery task id. Use this to fetch the task state. + - media_files: Files relevant to this that have actually been processed and are available for various types of display. Stored like: {'thumb': ['dir1', 'dir2', 'pic.png'} @@ -190,6 +192,7 @@ class MediaEntry(Document): # For now let's assume there can only be one main file queued # at a time 'queued_media_file': [unicode], + 'queued_task_id': unicode, # A dictionary of logical names to filepaths 'media_files': dict, -- cgit v1.2.3 From 84abd2bbc43e2d92d429c679f49e237207057150 Mon Sep 17 00:00:00 2001 From: Caleb Forbes Davis V Date: Wed, 10 Aug 2011 12:48:23 -0500 Subject: Bug #372 - MediaEntry.thumbnail_file not used - deleted the thumbnail_file from the media_entries collection - added a migration to remove the field from previous db versions --- mediagoblin/db/models.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'mediagoblin/db/models.py') diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py index 4ef2d928..aff2a65b 100644 --- a/mediagoblin/db/models.py +++ b/mediagoblin/db/models.py @@ -169,8 +169,6 @@ class MediaEntry(Document): - attachment_files: A list of "attachment" files, ones that aren't critical to this piece of media but may be usefully relevant to people viewing the work. (currently unused.) - - - thumbnail_file: Deprecated... we should remove this ;) """ __collection__ = 'media_entries' @@ -196,10 +194,7 @@ class MediaEntry(Document): # The following should be lists of lists, in appropriate file # record form - 'attachment_files': list, - - # This one should just be a single file record - 'thumbnail_file': [unicode]} + 'attachment_files': list} required_fields = [ 'uploader', 'created', 'media_type', 'slug'] -- cgit v1.2.3 From 6c50c2106816c920ef404dea641a8eac8c5914eb Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sat, 13 Aug 2011 07:48:34 -0500 Subject: Add fail_error and fail_metadata fields to MediaEntry and relevant migration --- mediagoblin/db/models.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'mediagoblin/db/models.py') diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py index 0dcb6ce8..982883d7 100644 --- a/mediagoblin/db/models.py +++ b/mediagoblin/db/models.py @@ -171,6 +171,9 @@ class MediaEntry(Document): - attachment_files: A list of "attachment" files, ones that aren't critical to this piece of media but may be usefully relevant to people viewing the work. (currently unused.) + + - fail_error: path to the exception raised + - fail_metadata: """ __collection__ = 'media_entries' @@ -197,7 +200,12 @@ class MediaEntry(Document): # The following should be lists of lists, in appropriate file # record form - 'attachment_files': list} + 'attachment_files': list, + + # If things go badly in processing things, we'll store that + # data here + 'fail_error': unicode, + 'fail_metadata': dict} required_fields = [ 'uploader', 'created', 'media_type', 'slug'] -- cgit v1.2.3 From 6ee9c719025f954bfc996f11b4a89219f635a17f Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sun, 14 Aug 2011 07:55:08 -0500 Subject: Method to get the failure exception object for a MediaEntry, if appropriate. --- mediagoblin/db/models.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mediagoblin/db/models.py') diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py index 982883d7..b6e52441 100644 --- a/mediagoblin/db/models.py +++ b/mediagoblin/db/models.py @@ -297,6 +297,13 @@ class MediaEntry(Document): def uploader(self): return self.db.User.find_one({'_id': self['uploader']}) + def get_fail_exception(self): + """ + Get the exception that's appropriate for this error + """ + if self['fail_error']: + return util.import_component(self['fail_error']) + class MediaComment(Document): """ -- cgit v1.2.3