1855 Commits

Author SHA1 Message Date
Elrond
28306810c5 Convert (gps) image media_data.
Add mongo_to_sql convert part for converting the media_data
for images. This currently drops the exif data and thus
only converts gps data.
2012-03-14 21:17:07 +01:00
Elrond
ea200c32ac Change image processing to create new .gps_*.
The processing should also create .gps_* instead of the old
['gps']['x']. To ease forward porting, use the new
media.media_data_init() to set the gps data in the media.
2012-03-14 20:17:49 +01:00
Elrond
e0b2b245fe Use .gps_* in the template and add translations.
Instead of .gps.x use .gps_x and add some "is defined" and
stuff.

Also mark some strings for translation in here.
2012-03-14 20:17:49 +01:00
Elrond
ca722c3caf Migration to move gps data around
Move media_data["gps"]["*"] to media_data["gps_*"].
In preparation for media_data.gps_*
2012-03-14 20:17:49 +01:00
Christopher Allan Webber
dc84dbee7f Merge branch 'elrond-sql-convert_video_data' 2012-03-14 14:04:05 -05:00
Christopher Allan Webber
4a86335157 Fix VideoData insertion 2012-03-14 14:03:49 -05:00
Christopher Allan Webber
e5fce8a50c Preserve existing translation 2012-03-14 12:44:19 -05:00
Christopher Allan Webber
ff6933fa4c Provide a source link so we can comply with the AGPL 2012-03-14 12:38:55 -05:00
Elrond
ef7de98ad5 Convert media_data for video
This creates fresh VideoData rows for all the videos in the
mongodb.
2012-03-13 23:08:34 +01:00
Christopher Allan Webber
19e67f5955 Merge remote-tracking branch 'refs/remotes/chemhacker/bug402_nicer_skin_for_video'
Conflicts:
	mediagoblin/templates/mediagoblin/media_displays/video.html
2012-03-13 15:40:59 -05:00
Sacha De'Angeli
560e22e7d2 adding the video.js wrapper 2012-03-12 19:44:55 -05:00
Christopher Allan Webber
849cf91fc8 Merge branch 'master' of gitorious.org:mediagoblin/mediagoblin 2012-03-12 18:38:35 -05:00
Elrond
cc9f9a1dd3 Another .one -> .find_one
Same idea as in the previous commit.
Joar caught this one.

To reproduce
1. Create a user with an all-decimal ObjectId in mongo
2. Login using that user, while mongodb is enabled.
3. Switch instance to sql.
4. Restart.
5. Refresh any page.

This will error, because no user with that object id exists
any more.

While around, improved logging.
2012-03-13 00:19:53 +01:00
Christopher Allan Webber
1f36e6bee9 Merge remote-tracking branch 'derek-moore/bug293_non_ascii_password' 2012-03-12 18:19:03 -05:00
Derek Moore
20a3e278bc Changes for 293. Tests pass, encode UTF8 on password on registration (and also for subsequent logins once the user is created) is working. 2012-03-12 16:02:42 -07:00
Elrond
84812db59d Change user search from .one to .fine_one.
When searching for a user by username, there can either be
no result or one result. There is a unique constraint on
the db.

.one in mongokit raises an error for more than one result.
But that can't happen anyway. So no problem.

.one in sqlalchemy raises an error for more than one, but
that's not a problem anyway. It also raises an error for no
result. But no result is handled by the code anyway, so no
need to raise an exception.

.find_one doesn't raise an exception for more than one
result (no problem anyway) and just returns None for no
result. The later is handled by the code.
2012-03-12 23:46:04 +01:00
Elrond
dd0799ad0a Better media_data sql table for images.
1. Change to the current primary key = media_entry id
   layout
2. Add gps_{latitude,longitude} to the table.
2012-03-12 21:21:35 +01:00
Sacha De'Angeli
4badfd9317 adds video preload bug 375 2012-03-12 14:57:31 -05:00
Christopher Allan Webber
8bc894e82b Added m4v to list of media types and a comment stating we should
autogenerate extension list
2012-03-12 13:38:22 -05:00
Jef van Schendel
fcc0f4e81d Slight change to thumbnail gallery style 2012-03-11 00:03:50 +01:00
Elrond
193e0f5346 Improve logging of sql queries a bit.
Docs:
  http://docs.sqlalchemy.org/en/latest/core/engines.html#configuring-logging

So for an application utilizing python logging for real
(and MediaGoblin should) the rule is:
- Don't use echo=True,
- but reconfigure the appropiate loggers' level.

So replaced the echo=True by a line to reconfigure the
appropiate logger to achieve the same effect.

This still dumps whole bloats of SQL queries into the main
log, but at least they're not duped any more.
2012-03-10 22:48:24 +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
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