131 Commits

Author SHA1 Message Date
Jakob Kramer
32d8cf4511 remove unused `mg.submit.security' module 2012-03-23 22:13:48 +01:00
Elrond
eace050a7d Move celery task into own task.py
Move the actual celery task from processing/__init__.py
into its own .../task.py. That way it can be imported as
needed.
2012-03-21 12:12:07 +01:00
Elrond
58f96a13e4 Allow .id instead of ._id for the Mongo backend
To allow easier migration to the SQLAlchemy style .id give
the User and MediaEntry mongo classes an alias attribute of
.id that maps to ['_id'].

Use it in the upload process, because this was one of the
last positions with a ['_id'] instead of ._id (due to a bug
in mongokit).
2012-02-25 14:10:57 +01:00
Elrond
572d4f01ff Use task_id in generating the queue file path
The task_id is created anyway as a UUID. So it is very
unique per definition. The only thing needed for the queue
file path is a unique part.

Before the objectid of the MediaEntry was used instead. But
in the sql world the objectid is only available after an
"insert" on the db. And creating the queue_file_path
afterwards would require an "update" on the db. We can save
that. ... for now.
2012-02-21 20:47:26 +01:00
Elrond
1e72e075f8 Drop pre-rendered html: MediaEntry.description_html
After a bit of discussion, we decided to drop the
pre-rendered html from the database and render it on
the fly.

In another step, we will use some proper caching method to
cache this stuff.

This commit affects the MediaEntry.description_html part.
2012-02-18 12:41:25 +01:00
Joar Wandborg
ec4261a449 Changed media processing delegation to a 'sniffing' method
- Added sniff handlers to all media plugins
  All of them except audio returning False for ANYTHING
  at the moment.
2012-02-15 01:15:29 +01:00
Christopher Allan Webber
cf29e8a824 It's 2012 all up in here 2012-02-02 09:44:13 -06:00
Elrond
de91730336 Nearly complete support for Tags
These changes allow all of the rest of the code to use tags
in sql as they were used on mongo. It's not efficient at
all, as changing tags usually means to remove all old tags
and adding all new.

The only problem here is: Old slugs for tags are not
removed, because they're shared across all MediaTags and
dropping orphans is not always easy.
2012-01-28 19:32:43 +01:00
Christopher Allan Webber
2788e6a164 License "all rights reserved" default should be None/NULL, not empty string 2012-01-21 16:40:39 -06:00
Elrond
3c351460e1 Fix unit tests with new license support
Make the license field in the forms optional and let them
properly be defaulted to "".
2012-01-21 19:24:36 +01:00
Aaron Williamson
97ec97dbc7 Minor formatting and syntax fix. 2012-01-18 21:21:49 -05:00
Aaron Williamson
291e24f397 Merge branch 'mediagoblin-upstream' into feature544_basic_license_data 2012-01-18 20:40:18 -05:00
Michele Azzolari
c03d13cd79 Cleaned the code 2012-01-17 23:15:47 +01:00
Michele Azzolari
77b91efcc2 We handle exceptions if PuSH fails 2012-01-17 22:42:36 +01:00
Aaron Williamson
99a270e952 Merged changes with upstream 2012-01-17 00:59:21 -05:00
Aaron Williamson
25b48323a8 First crack at basic license support. 2012-01-17 00:33:55 -05:00
Michele Azzolari
bb025ebda1 As per spec, we permit to have more then 1 hub 2012-01-12 11:05:05 +01:00
Michele Azzolari
7f251b037b As suggested by Elrond, we use only one setting 2012-01-12 00:00:28 +01:00
Michele Azzolari
5b1a7bae3c Added PuSH capability 2012-01-11 15:48:37 +01:00
Elrond
8545cfc97d Dot-Notation for MediaEntry.queued_media_file 2012-01-04 11:57:39 +01:00
Joar Wandborg
4601c30c2e Fixed submission error handling and broken tests
- Fixed broken test_auth test
- Fixed error handling on submission, it now raises the exception
  if it is not explicitly relevant to file submission.
2011-12-31 22:57:08 +01:00
Joar Wandborg
a246ccca69 ASCII media type support & fix a bug in file submission error handling
* Added ASCII media processing
* Added ASCII media display
* Added ASCII media type

Rebased from Joar Wandborg's ascii art branch (squashed to remove the
commits borrowing code of dubious license)

Fixed a bug in file submission error handling:
 - Moved file-extension condition out of loop (what did it do there?)
 - Updated file submission tests
 - Changed error handling in file submission, should now report more
   than absolutely necessary.
2011-12-31 10:32:52 -06:00
Elrond
f4ee839939 Dot-Notation for MediaEntry.media_type 2011-12-05 21:08:58 +01:00
Elrond
1d93996604 Dot-Notation for MediaEntry.description(_html) 2011-12-05 21:08:58 +01:00
Elrond
ec82fbd85c Dot-Notation for MediaEntry.title 2011-12-05 21:08:58 +01:00
Elrond
1ceb4fc868 Dot-Notation for MediaEntry.uploader 2011-12-05 21:08:58 +01:00
Elrond
5a4e3ff1e2 Dot-Notation for Users.username 2011-12-05 21:08:57 +01:00
Joar Wandborg
0bce749b21 Fixes after merging video into master - part 2
- Added handling of InvalidFileType to submit.views
- Updated test_celery_setup and test_submission tests to reflect the changes to the
  media procesing infrastructure
2011-11-21 23:38:31 +01:00
Joar Wandborg
8e5f974684 Fixes after merging video branch into master
- Removed debug output from init/celery
- Moved process_media/__init__ to processing.py
- Centralized the processing.ProcessMedia task class
  - Updated media managers to reference the processing function
    instead of the ProcessMedia instance
  - Updated new-style image processing to previous, newer old-style
    image processing
- Updated video transcoding
  - Changed method in progress output, sometimes
    message.structure['percent'] raises KeyError
2011-11-21 23:18:40 +01:00
Joar Wandborg
b9e1fa280e Merge branch 'video_gstreamer-only'
Conflicts:
	mediagoblin/db/migrations.py
	mediagoblin/submit/views.py
2011-11-21 21:51:30 +01:00
Elrond
3618a9ac51 Dot-Notation: x._id = ObjectId() doesn't seem to work properly
For whatever reason, this does not work as expected:
	entry._id = ObjectId()
Need to go this way:
	entry['_id'] = ObjectId()
2011-11-15 11:32:13 +01:00
Elrond
eabe6b678a Dot-Notation for "_id"
Note: Migrations can't use "Dot Notation"!

Migrations run on pymongo, not mongokit.
So they can't use the "Dot Notation".
This isn't really a big issue, as migrations are anyway
quite mongo specific.
2011-11-15 11:32:13 +01:00
Christopher Allan Webber
ee91c2b88d Merge remote-tracking branch 'remotes/nyergler/pep8-ification'
Conflicts:
	mediagoblin/db/migrations.py
	mediagoblin/db/models.py
	mediagoblin/user_pages/views.py
	mediagoblin/util.py
2011-11-13 20:23:26 -06:00
Nathan Yergler
285ffeddf3 has_key is deprecated, converting uses to use "in" operator. 2011-10-01 15:10:41 -07:00
Nathan Yergler
243c3843bd Whitespace and formatting cleanup.
* Removed trailing whitespace
* Line length < 80 where possible
* Honor conventions on number of blank lines
* Honor conventions about spaces around :, =
2011-10-01 15:10:02 -07:00
Aaron Williamson
152a3bfaa3 Finished splitting util.py into separate files. 2011-10-01 18:05:44 -04:00
Aaron Williamson
ae3bc7fabf Moved common, translation, template, and url code out of util.py and into tools/[file].py 2011-10-01 09:31:42 -04:00
Joar Wandborg
93bdab9daa Multimedia support - Commiting from a not yet finished state - Details below
* DONE Initially testing with arista
** DONE Video display templates
*** TODO Multi-browser support
** TODO Video thumbnails
** TODO Link to original video
** TODO Video cropping

Also contains a lot of "debug" print's
2011-09-23 02:35:57 +02:00
Will Kahn-Greene
12a100e4d8 508. Updates copyright/license information 2011-09-01 20:50:19 -04:00
Christopher Allan Webber
7dc3a66f92 Merge remote branch 'remotes/jwandborg/f403_ability_to_delete'
Conflicts:
	mediagoblin/edit/views.py
	mediagoblin/templates/mediagoblin/user_pages/media.html
	mediagoblin/user_pages/routing.py
2011-08-28 22:05:54 -05:00
Christopher Allan Webber
894fa564e7 Merge branch 'master' into jwandborg-f482_media_attachments
Conflicts:
	mediagoblin/config_spec.ini
	mediagoblin/edit/forms.py
	mediagoblin/edit/views.py
	mediagoblin/submit/views.py
	mediagoblin/templates/mediagoblin/user_pages/media.html
2011-08-22 21:48:45 -05:00
Joar Wandborg
3a8c3a3855 Feature #482 - Media attachments -
*   Moved attachment uploading to separate view
*   Support for multiple attachments!
2011-08-22 18:06:28 +02:00
Mark Holmquist
08750772ea + 'confirm' section for confirmation dialogues
+ implemented delete functionality
* fixed several instances of 'must be an instance of unicode, not str'
2011-08-22 02:57:40 -07:00
Christopher Allan Webber
6788b4123e Capture and properly handle errors.
Handled in several places:

 - In the run() of the ProcessMedia itself for
   handled (BaseProcessingFail derived) errors (best to do these not
   in on_failure because the errors are highlighted in celeryd in a
   way that looks inappropriate for when the errors are well handled)
 - In ProcessMedia.on_failure() for all other errors
 - In the submit view where all exceptions are caught, media is marked
   at having failed, then the error is re-raised.  (The reason for
   this is that users running in "lazy" mode will get errors
   propagated by celery and so on_failure won't run for them.)
2011-08-13 12:21:06 -05:00
Christopher Allan Webber
4a477e246d Proper handling of processor failures, working as hoped!
BaseProcessingFail based exceptions recorded and marked appropriately
in the database.  Other exceptions also caught and marked (or rather
not marked) appropriately in the database as well.
2011-08-13 10:59:34 -05:00
Christopher Allan Webber
07934b442f Moving things around a bit/commenting in the submit view to make the workflow clearer 2011-08-11 11:30:26 -05:00
Christopher Allan Webber
1b57c29082 Merge branch 'master' into processing 2011-08-10 21:04:55 -05:00
Christopher Allan Webber
f64e525090 Generate the ObjectId() manually instead of via .save() 2011-08-10 21:03:16 -05:00
Christopher Allan Webber
d990a37998 We should save the entry *after* we add the queued_task_id. 2011-08-10 20:26:22 -05:00
Christopher Allan Webber
852d5bb238 Merge branch 'master' into processing 2011-08-10 19:53:37 -05:00