2044 Commits

Author SHA1 Message Date
Joar Wandborg
9743ce886a Replaced 'not foo == None' with 'foo is not None' in ascii sniffing too 2012-03-08 23:49:41 +01:00
Joar Wandborg
e2007352f5 Clean up the workbench after audio processing 2012-03-08 23:03:52 +01:00
Joar Wandborg
e2caf5743c Changed not foo == None to foo is not None in image sniff handler
>>> class foo(object):
       def __eq__(self, other):
           return True

  >>> f = foo()
  >>> f == None
  True
  >>> f is None
  False

-- <http://stackoverflow.com/questions/26595/is-there-any-difference-between-foo-is-none-and-foo-none>
2012-03-08 22:58:16 +01:00
Elrond
3c7d451c71 Forgot to add FileKeynames to MODELS 2012-03-08 21:18:17 +01:00
Elrond
a9dac7c83d Normalize MediaFile.name (make it a foreignkey)
The name part of a MediaFile is only using a very limited
number of items. Currently things like "original" or
"thumb".

So instead of storing the string on each entry, just store
a short integer referencing the FileKeynames table and have
the appropiate string there.
2012-03-08 21:11:18 +01:00
Joar Wandborg
703d09b985 Changed from key-notation to dot-notation in edit_profile 2012-03-08 01:02:40 +01:00
Joar Wandborg
4dbf16be33 SQL: Added MediaFile and MediaAttachmentFile to MODELS 2012-03-08 01:02:06 +01:00
Joar Wandborg
034a0e0b97 Added a notice about mgg.global_config perhaps sometime not
being loaded before mediagoblin.processing is imported.
2012-03-08 00:06:37 +01:00
Joar Wandborg
4f4f2531ad Removed diaper patterns from audio/video sniffers, video preload set to 'metadata'
* mediagoblin.processing THUMB_/MEDIUM_ constants are now based on the ini settings
* Removed diaper patterns from audio and video sniffing
* Changed HTML5 video preload to 'metadata'
2012-03-07 22:48:23 +01:00
Elrond
814334f6eb Generic generate_slug for mongo and sql.
Using the new check_media_slug_used it is possible to have
one generic generate_slug in the mixin class instead of in
each db class.

In the sql variant self.id is not always set: If the slug
alone would create a dupe the current code decides for "no
slug at all".
2012-03-07 21:32:20 +01:00
Jef van Schendel
74743bed0a Push another half-fix for portrait thumbnails. Man, this thing is breaking all over the place. 2012-03-07 16:29:02 +01:00
Jef van Schendel
2b7b701019 Sort-of fixes so the header does not collapse anymore. Header needs redesigning. 2012-03-07 16:24:23 +01:00
Jef van Schendel
8860fd0708 Header doesn't need a height 2012-03-07 16:17:21 +01:00
Jef van Schendel
c4370069ec Actually decrease thumbnail size instead of just their containers 2012-03-07 16:11:24 +01:00
Elrond
0dedf3f2cf Translate less html.
Instead of translating <p ...>TEXT</p> just mark TEXT for
translation. That way formatting changes can be done
without affecting the translations.
2012-03-06 14:49:42 +01:00
Jef van Schendel
3d541b04a9 Merge branch 'master' of gitorious.org:mediagoblin/mediagoblin 2012-03-06 00:36:15 +01:00
Jef van Schendel
b01a3b9386 Revert thumbnail gallery change: switch back to tables 2012-03-06 00:35:55 +01:00
Jef van Schendel
fe53180359 Fix merge conflict in prev_next.html 2012-03-06 00:31:34 +01:00
Elrond
b62b3b982a Generic check_media_slug_used db utility.
In two cases (generating a new slug and editing the slug)
it is nice to know in advance (before the db gets angry)
that the slug is used/free. So created a db utility
function to check for this on mongo and sql:
check_media_slug_used()
2012-03-05 21:37:05 +01:00
Elrond
c65cbf9514 SQL: Tool to cleanup unused tag slugs.
The current SQL layout/sqlalchemy strucuture can't detect
whether a slug isn't needed any more and delete it. So
provide a tool function to cleanup unused slugs.

It's currently not hooked to any gmg function!
2012-03-05 21:30:39 +01:00
Jef van Schendel
1213b8260a Stop failing if there is no previous/next to go to 2012-03-05 19:27:26 +01:00
Jef van Schendel
5cacba2395 Merge branch 'keyboard_nav' 2012-03-05 19:21:59 +01:00
Jef van Schendel
e58f259965 Edit css rule to allow users to zoom 2012-03-05 18:47:31 +01:00
Joar Wandborg
c898fa5acc Added the sql_switch.py script to .gitignore 2012-03-05 17:15:43 +01:00
Elrond
325ca444d1 Implement atomic_update for SQL.
On sqlalchemy most updates are atomic enough for most use
cases. Anyway, here is an atomic_update that is compatible
to the mongo version.
2012-03-04 21:05:06 +01:00
Elrond
82cd968347 Create atomic_update db utility function
In some cases (notably the mark_entry_failed function) it
is useful to have atomic update functionality on the db. On
mongo this requires special syntax.

So created an atomic_update function for mongo and started
to use it in mark_entry_failed.
2012-03-04 20:58:19 +01:00
Jef van Schendel
141f14e27e Add sidebar again 2012-03-04 19:13:47 +01:00
Jef van Schendel
822d37176e Merge branch 'newlayout' into newlayout-stage 2012-03-04 19:05:41 +01:00
Elrond
b8e635b22f Merge branch 'media_data_start'
* media_data_start:
  And media_data_init() for sql as a dummy
  Create a fake MediaEntry.media_data for sql
  Video media_data: Change layout in the mongo world
2012-03-03 21:25:20 +01:00
Elrond
acb2194919 And media_data_init() for sql as a dummy
Needs to be implemented.
2012-03-03 21:12:57 +01:00
Elrond
5fe1fd0722 Create a fake MediaEntry.media_data for sql
So that the SQL backend is more useable, let the MediaEntry
have a faked media_data.
It's extremely fake: The returned dict is always a new one.
So any stored info is even lost!
2012-03-03 00:16:44 +01:00
Christopher Allan Webber
f4459ecfd8 Go go mediagoblin favico symmetry 2012-03-01 17:30:07 -06:00
Elrond
5ff575827b Video media_data: Change layout in the mongo world
Change the media_data for video from
entry.media_data["video"] to use entry.media_data directly.

Also start a bare MediaEntry.media_data_init(**kwargs)
method for setting up the media_data and possibly
initialising it with kwargs.
2012-03-01 22:25:41 +01:00
Elrond
94df840b3b SQL: Improve video media_data table
1. Make the foreignkey the primary_key.
2. Add width/height, as those are currently in use for the
   media_data
2012-03-01 21:58:49 +01:00
Joar Wandborg
10085b7739 Audio thumbnailing & spectrograms, media plugins use sniffing
* Added extlib/freesound/audioprocessing.py
* config_spec
  * Added create_spectrogram setting
  * Added media:medium and media:thumb max_{width,height} settings
* Added sniffing logic to
  - audio.processing:sniff_handler
  - video.processing:sniff_handler
* Changed audio.processing:sniff_handler logic
* Added audio thumbnailing functionality to audio.processing
  (works only with create_spectrogram enabled)
* Refractored contexts in audio.processing
* Added audio.transcoders:AudioThumbnailer
  Used for creating spectrograms and spectrogram thumbnails -
  Wadsworth's Constant, we meet again :)
* audio.transcoders:AudioTranscoder
  - Added mux_string kwarg
  - Delete self.pipeline on self.halt()
* Changed str.format formatting in image.processing:sniff_handler
  Had {1} without an {0}, changed to {0}
* Refractored VideoTranscoder to use transcode() for transcoding instead
  of __init__()
* Added discover() method to video.transcoders:VideoTranscoder
* Added spectrogram display to media_displays/audio.html
* Updated test_submission to reflect changes in media plugin delegation
2012-02-28 21:59:38 +01:00
Elrond
2bc8ff0d63 Cleanup Session after each request.
It's good practice to cleanup the SQL session after each
request so that the next request gets a fresh one.

It's an application decision whether one wants a
just-in-case ROLLBACK or COMMIT. There are two ideas behind
it, really. I have decided for ROLLBACK. The idea is "if
you forget to commit your changes yourself, there's
something broken. Maybe you got an exception?".
2012-02-28 20:52:35 +01:00
Elrond
3502958113 Attachment support in the SQL backend
attachments working with the sql backend.

- SQL Schema for attachment files, ordering attachments by
  their name, not by the submission order (as earlier).
- Dot-Notation for attachments, where missing.
- convert existing attachments over from mongo -> sql
2012-02-28 20:52:35 +01:00
Christopher Allan Webber
e9f87f728c Fix tests given recent celery "case" change 2012-02-28 13:31:03 -06:00
Luke Slater
4f9f969dec Accidentally overwrote the celery/__init__.py, fixed this and removed the upper correctly 2012-02-28 16:47:38 +00:00
Luke Slater
6bcdd4dc70 Changed celery config keys to upper case and removed upper casing of keys when initialising the config as per issue #214 2012-02-28 16:40:37 +00:00
Elrond
baae1578da Let mark_entry_failed log unknown exceptions
I don't know exactly why, but an exception during
processing hasn't found its way up. The entry was marked as
failed and that was it. So I decided to add a _log.warn to
the part of mark_entry_failed that handles general
exceptions.
2012-02-27 23:16:08 +01:00
Elrond
34344f1d85 Merge remote-tracking branch 'cwebber/celerysql'
* cwebber/celerysql:
  Adjust unit tests to match new celery/kombu sqlalchemy setup
  "database" is not the sqlalchemy kombu transport... should be "sqlalchemy"
  Celery and kombu databases should also be .gitignore'd
  kombu-sqlalchemy a requirement in order for kombu sqlalchemy transport to work
  Move mediagoblin dbs out of user_dev for race condition directory-creation reasons.
  Give kombu its own db.  Responding to Elrond "sqlite will lock all the time!" :)
  Apparently an absolute path is three slashes after sqlite:.  Thx elrond.
  Should be all that's needed to switch celery/kombu settings to sqlalchemy
2012-02-27 21:55:02 +01:00
Christopher Allan Webber
6b38a38a91 Committing extracted and compiled translations 2012-02-26 15:51:11 -06:00
Christopher Allan Webber
42d0d8f3cd Committing present MediaGoblin translations before pushing extracted messages 2012-02-26 15:51:00 -06:00
Christopher Allan Webber
a9a63a686e Adjust unit tests to match new celery/kombu sqlalchemy setup 2012-02-26 15:45:58 -06:00
Christopher Allan Webber
b8e1abf782 "database" is not the sqlalchemy kombu transport... should be "sqlalchemy" 2012-02-26 13:27:09 -06:00
Christopher Allan Webber
a68e3e8320 Celery and kombu databases should also be .gitignore'd 2012-02-26 13:26:44 -06:00
Christopher Allan Webber
b594eadfbf kombu-sqlalchemy a requirement in order for kombu sqlalchemy transport to work 2012-02-26 13:25:02 -06:00
Elrond
c60bbe07c5 Let SQL objects support .setdefault() and .delete()
Some parts in the code like to use .setdefault(). So make
them happy and provide a minimal version. It ignores the
given default and expects the attribute to already exist.

Other parts use .delete() to delete a complete object. This
version expects the object to live in a session and also
does the final commit.
2012-02-26 19:46:44 +01:00
Elrond
8efcd40558 Dot-Notation: MediaComment and some random places 2012-02-26 19:19:48 +01:00