2976 Commits

Author SHA1 Message Date
Sebastian Spaeth
99a54c0095 Make copying to/from storage systems memory efficient (#419)
The copy_locally and copy_local_to_storage (very inconsistent terms BTW)
were simply slurping in everything in RAM and writing it out at once.
(the copy_locally was actually memory efficient if the remote system was local)

Use shutil.copyfileobj which does chunked reads/writes on file objects.
The default buffer size is 16kb, and as each chunk means a separate HTTP
request for e.g. cloudfiles, we use a chunksize of 4MB here (which has
just been arbitrarily set by me without tests).

This should help with the failure to upload large files issue #419.
2013-03-03 14:40:06 -06:00
Christopher Allan Webber
4f239ff194 Another elrond suggestion: only init orig_metadata if there's anything in the dict.
This commit sponsored by Joshua Rosen.  Thank you!
2013-03-03 14:29:30 -06:00
Christopher Allan Webber
9d4cebfd36 Per Elrond's suggestions moving DEFAULT_WEBM_TYPE to media manager
The reason for this is to avoid defining this twice as we were
previously (once in the template, once in video/models.py)

This commit sponsored by Roland McIntosh.  Thank you!
2013-03-03 14:27:36 -06:00
Christopher Allan Webber
787aafd644 Extrapolate type= based on the video metadata that we have, if we can.
It's kind of awkward because it relies on there being a entry.media_data,
but that's not guaranteed... (see http://issues.mediagoblin.org/ticket/650)
so we use a dopey fallback in the template in that case (kind of
annoying info duplication).

This commit sponsored by Piotr Wieczorek.  Thank you!
2013-03-03 11:41:40 -06:00
Christopher Allan Webber
b35dfd3271 Mild cosmetic cleanups to video.html and adding missing </li> elements.
This commit sponsored by Jukka Hellen.  Thanks!
2013-03-03 11:08:14 -06:00
Christopher Allan Webber
14814f217a {% set %} the display_type and display_path and use that elsewhere
This will make some stuff a bit cleaner that's coming up...

This commit sponsored by J B Nicholson-Owens.  Thanks!
2013-03-03 11:03:30 -06:00
Christopher Allan Webber
3ff006ef3b pdb.set_trace() in mediagoblin code is Not Allowed(TM), removing from audio code
Of course, the version that appears here is not really dangerous
because it's for the "call the file individually" form of debugging,
but it isn't allowed anyway.

This commit sponsored by Michael Faryniarz.  Thanks!
2013-03-03 10:38:06 -06:00
Christopher Allan Webber
29adab4651 Now store metadata info from processing into the media type.
This comes in several parts:
 - Store the metadata from gstreamer during processing
 - Add a new JSONEncoded field to the VideoData table
 - And, of course, add a migration for that field!

This commit sponsored by Julius Tuomisto.  Thank you, Julius!
2013-03-03 10:36:37 -06:00
Joar Wandborg
3ff4f75203 Removed debugging exception
.. that accidentally got included due to not testing the video media
type in the unit tests.
2013-03-03 08:48:12 +01:00
Joar Wandborg
f3f530286f Updated raven plugin
- Added wrap_wsgi, celery_setup, celery_logging_setup hooks
- Updated raven plugin docs
- Updated production considerations docs
- Added raven logging setup
2013-03-03 02:32:03 +01:00
Christopher Allan Webber
ddbf6af1e2 Huge amount of work to (mostly) allow .ogg (and maybe other) formats to skip transcode
- Update get_display_media in several ways:
   - now uses the media type's own declaration of the order of things
   - returns both the media_size and the media_path, as per the docstring
   - implicitly uses self.media_files as opposed to forcing you to pass it in
 - update videos to use get_display_media
 - update images to declare media_fetch_order in the media manager (videos also)
 - update stl to use media.media_files['original'] instead of weird
   use of get_display_media
 - update sidebar to only conditionally show webm_640

TODO still: identify video type information *during* processing, show
that in the <video><source /></video> element.

This commit sponsored by Nathan Yergler.  Thanks, nyergler!
2013-03-02 19:06:31 -06:00
Joar Wandborg
40ef3f5e05 plugin/raven: Fix paster's celery config issue
Check for CELERY_CONFIG_MODULE before we import raven.contrib.celery. It
seems that the import otherwise sets up the celery client before we get
to pass it our mediagoblin-specific settings.
2013-03-03 00:46:05 +01:00
Joar Wandborg
35f1f75922 Added raven plugin docs to docs 2013-03-03 00:46:05 +01:00
Joar Wandborg
32174bedc1 Removed stray ) 2013-03-03 00:46:05 +01:00
Joar Wandborg
dee408291a Removed PLUGIN_DIR from raven 2013-03-03 00:46:05 +01:00
Joar Wandborg
0c1ae3518e Don't look for the oauth config in raven plugin 2013-03-03 00:46:05 +01:00
Joar Wandborg
b9c5c97238 Refactored raven plugin 2013-03-03 00:46:05 +01:00
Joar Wandborg
3fbba1af82 Added raven plugin 2013-03-03 00:46:05 +01:00
Joar Wandborg
e11bc1991d Added .send method to cloudfiles storage object
.. wrapper. Also added some logging - A .warn() for the legacy .write()
method and a .debug() for the new copy_local_to_storage()
2013-03-03 00:11:34 +01:00
Sebastian Spaeth
8b35e7ad15 Make Cloudfiles copy memory efficient too (#419)
It seems that (our implementation of) cloudfiles.write() takes
all existing data and appends write(data) to it, sending the
full monty over the wire everytime. This would of course
absolutely kill chunked writes with some O(1^n) performance
and bandwidth usage. So, override this method and use the
Cloudfile's "send" interface instead.

Also make the Cloudfile file wrapper an iterator that allows us to
simply do "for data in cloudfile:" which will stream the data in a
memory-efficient way.

DO NOTE THAT THIS PATCH IS COMPLETELY UNTESTED DUE TO LACK OF SETUP
PLEASE REVIEW AND VERIFY.
2013-03-02 23:44:54 +01:00
Joar Wandborg
77c85224b1 Fixed hidden fields in oauth client authorization
Removed the translation marking and passed in empty strings to avoid
WTForms automagically creating the labels from the field names (i.e.
client_id => 'Client Id').
2013-03-02 23:42:03 +01:00
Joar Wandborg
56c113c770 Do not encode the next kwarg twice 2013-03-02 23:21:03 +01:00
Elrond
0e80b31626 Turn "License preference" into a normal field.
instead of rendering it by hand, use the normal field
rendering tools.

Old:
	[choose box] License preference
New:
	License preference
	[choose box]
	This will be your default license on upload forms.
2013-03-02 16:07:11 +01:00
Christopher Allan Webber
fd693e368b If we're not transcoding, copy this file directly over to ['original']
There's no reason to copy it over to 'webm_640' in such a case,
clearly.

Added logic so we don't do it twice either.

Haven't tested this yet though ;)

This commit sponsored by Algot Runeman.  Thank you!
2013-03-01 17:28:07 -06:00
Christopher Allan Webber
ed6344009a Merge branch 'master' into joar-skip_transcoding
Conflicts:
	mediagoblin/config_spec.ini
2013-03-01 16:29:22 -06:00
Elrond
b7a3798e18 Fix some media page redirects in media_collect.
Use .slug_or_id instead of only .id.
2013-03-01 22:08:24 +01:00
Elrond
918d811a78 Fixup _("...") % (...) in media_collect.
Get some messages translated.

Bad:  _("..." % (...))
Good: _("...") % (...)
2013-03-01 22:07:12 +01:00
Christopher Allan Webber
42de9886cf MediaGoblin not really anything to do with FooCorp anymore. 2013-02-27 14:08:38 -06:00
Christopher Allan Webber
a808364e7f Fixing translations stuff for command line tools and such.
We had switched mg_globals to have the default translations set to
None so that it would be set up by the mediagoblin app later.
However, this would mean that things like scripts would try to call
gettext and error out.

Thanks to Tumulte for catching this.

This commit sponsored by Aurimas Fišeras.  Thank you!
2013-02-27 13:25:42 -06:00
Christopher Allan Webber
aecd65b789 Simplifying the test for whether or not a user and slug combo exists.
Thanks to tchernobog for catching this (it was breaking on postgres)
and Elrond for the suggestion on how to fix it.

This commit sponsored by Caleb Cooper.  Thanks Caleb!
2013-02-27 09:56:56 -06:00
Christopher Allan Webber
8db7eed3bc Removing html5shiv for not complying with its own licenses and racism
Issues of racism seem to have been resolved and removed from upstream,
but make having this as a dependency somewhat uncomfortable:
  https://github.com/aFarkas/html5shiv/issues/91

Regardless, at the time of writing the project doesn't comply with its
own license... it states to be dual licensed under MIT and GPLv2 but
distributes neither of these licenses with its source.
2013-02-26 17:50:11 -06:00
Joar Wandborg
6bdf9a1044 Allow media managers without sniff_handler 2013-02-27 00:30:51 +01:00
Christopher Allan Webber
443dcf867c Copying the license from the jquery repository rather than the generic MIT one.
Damned MIT and BSD licenses encouraging modification by every project
makes compliance annoying.
2013-02-26 17:17:27 -06:00
Christopher Allan Webber
e4e50a2765 Simplifying the "id:" url detection, per Elrond's suggestion.
As pointed out, we didn't need that nested if.

This commit sponsored by Paul Kuriakose.  Thank you!
2013-02-26 14:04:26 -06:00
Christopher Allan Webber
697c74c2de Replacing several request.matchdict['media'] -> media_slug ... shorter!
Thanks for pointing this out, Elrond ;)

This commit sponsored by Gerardo Joven Valdivia.  Thank you!
2013-02-26 13:54:19 -06:00
Christopher Allan Webber
7de20e5234 Media URLs with ids in them are now like /u/cwebber/m/id:4112/ rather than /u/cwebber/m/4112/
This avoids some potential name collision issues.

This commit sponsored by Asokan Pichai.  Thank you!
2013-02-26 13:38:11 -06:00
Christopher Allan Webber
397c22d139 Stylistic cleanups to some urlgen calls.
This commit sponsored by Stephane Berube.  Thank you!
2013-02-26 13:08:23 -06:00
Christopher Allan Webber
67c7c81162 Small PEP-8 compliance fix.
This commit sponsored by Mats Sjöberg.  Thanks!
2013-02-26 10:33:51 -06:00
Christopher Allan Webber
ab1f65e6d7 Import sqlalchemy's and_ and use it in our select statement
This commit sponsored by Hans-Jörg Dollansky.  Thank you!
2013-02-26 10:15:26 -06:00
Christopher Allan Webber
0b7cdb6f3e And of course, we need to actually commit at the end of a migration.
This commit sponsored by Tamas Kemenczy.  Thanks, Tamas!
2013-02-26 09:58:25 -06:00
Christopher Allan Webber
0c6a34bf5c Dope'ily missed .count() on the query where we're counting
Thanks for catching, Elrond.

This commit sponsored by Graham King.  Thank you!
2013-02-25 16:35:05 -06:00
Christopher Allan Webber
e66431f4c3 Supplying migrations for a bold new era of mediagoblin entry slugs
Okay, that's a totally confusing statement, but the docstring of this
migration summarizes it well:

  Entries without slugs now display differently in the url like:
    /u/cwebber/m/id=251/

  ... because of this, we should back-convert:
   - entries without slugs should be converted to use the id, if possible, to
     make old urls still work
   - slugs with = (or also : which is now also not allowed) to have those
     stripped out (small possibility of breakage here sadly)

This commit sponsored by John Sullivan.  Thanks johnsu01! :)
2013-02-25 16:16:21 -06:00
Christopher Allan Webber
86f0ff75e3 You can now set the PASTE_CONFIG environment variable to control logging setup
So this should work:

  PASTE_CONFIG=/path/to/paste_foo.ini ./lazycelery.sh

Thanks to Laurent Fournier for sponsoring this commit!
2013-02-25 12:15:12 -06:00
Christopher Allan Webber
a49c741f11 Removing stray character from pythonsnake's doc change and filling comment
This commit sponsored by Johannes Knabbe.  Thank you!
2013-02-24 16:38:01 -06:00
pythonsnake
37b48053e9 Fix bug 461 2013-02-24 16:38:01 -06:00
Jef van Schendel
a5b9a066bf Improved dropdown styling, part deux 2013-02-24 21:09:16 +01:00
Jef van Schendel
42a8de4932 Merge branch 'master' of gitorious.org:mediagoblin/mediagoblin 2013-02-24 20:54:10 +01:00
Jef van Schendel
fe253e31b3 Improved dropdown styling 2013-02-24 20:53:34 +01:00
Christopher Allan Webber
76b399a3ef Changing the order so that config_spec.ini is mentioned after mediagoblin_local.ini
This commit sponsored by Matteo Settenvini.  Thanks!
2013-02-24 13:53:15 -06:00
Christopher Allan Webber
203f51a866 Merge remote-tracking branch 'refs/remotes/pythonsnake/581_config' 2013-02-24 13:52:13 -06:00