472 Commits

Author SHA1 Message Date
Boris Bobrov
c12a97b084 Use GLib instead of GObject
Thanks mi!

Fixes bug 5399
2016-07-25 03:39:23 +03:00
Christopher Allan Webber
da686c1998 Prevent erroring out in some cases of checking video metadata 2016-07-14 10:48:28 -05:00
Andrew Browning
41302ad2b6 Import messages in blog views 2016-04-03 01:10:22 -04:00
Andrew Browning
5c7b2a6381 Fix #5451 - add_message inconsistencies
Reformat add_message function calls for consistency and PEP8 line
continuations.
2016-04-02 19:59:01 -04:00
宋文武
c7a5551fb5 Fix the blog_delete page for admins.
* mediagoblin/media_types/blog/views.py: Import WARNING from mediagoblin.messages.
2016-04-02 16:55:28 +03:00
Christopher Allan Webber
90779509bb Blog media type initial migration.
* mediagoblin/media_types/blog/migrations/562bc42a8fff_blog_media_type_initial_migration.py:
  New file.
2016-03-26 11:39:07 -07:00
Christopher Allan Webber
c9ab4b8adb PDF media type initial migration.
* mediagoblin/media_types/pdf/migrations/faa209f143b5_pdf_media_type_initial_migration.py:
  New file.
2016-03-26 11:39:07 -07:00
Christopher Allan Webber
f1577a7257 STL media type initial migration.
* mediagoblin/media_types/stl/migrations/16134ed134ad_stl_media_type_initial_migration.py:
  New file.
2016-03-26 11:39:07 -07:00
Christopher Allan Webber
99a51bbde6 Ascii media type initial migration.
* mediagoblin/db/migrations/versions/72bd70f7eefd_ascii_media_type_initial_migration.py:
  New file.
2016-03-26 11:39:07 -07:00
Christopher Allan Webber
7d37209755 Video media type initial migration.
* mediagoblin/media_types/video/migrations/38feb829c545_video_media_type_initial_migration.py:
  New file.
2016-03-26 11:39:07 -07:00
Christopher Allan Webber
050bf6f438 Audio media type initial migration.
* mediagoblin/media_types/audio/migrations/e9212d3a12d3_adding_audio_media_type_initial_.py:
  New file.
2016-03-26 11:39:07 -07:00
Christopher Allan Webber
2d8b42aab3 Image media type initial migration.
* mediagoblin/media_types/image/migrations/a98c1a320e88_image_media_type_initial.py:
  New file.
2016-03-26 11:39:07 -07:00
Boris Bobrov
86dc32bc20 Check all tags for existence before using them
Fix bug 5401
2016-03-09 12:28:14 +03:00
Boris Bobrov
fec916dfbe Check tags for existence before using them
Closes bug 5401
2016-03-08 17:37:04 +03:00
Andrew Browning
ee7db0a3d1 Fix #5440 - Typo in blog views 2016-03-06 19:47:17 -05:00
Boris Bobrov
fa858bd717 removed debug prints, added video icon 2016-02-05 05:30:34 +03:00
Boris Bobrov
654d7cf94f Display type icon in thumbnails 2016-02-05 05:30:28 +03:00
Boris Bobrov
f13225fa6d Prevent dict changed during iteration in video 2016-02-05 04:32:19 +03:00
宋文武
ea309bff97 Pass filename instead of file object when calling PIL.Image.save() 2016-01-21 12:27:57 -08:00
ayleph
beb5a4a150 Fix issue 5366 Update blog views
This commit updates blog views to be compatible with recent database
migrations.

Signed-off-by: Jessica Tallon <tsyesika@tsyesika.se>
2016-01-15 10:15:41 +00:00
Boris Bobrov
63053f8c66 Merge branch 'stable' 2015-12-21 02:46:24 +03:00
Boris Bobrov
355d062dd4 Work around pbutils import warning bug (5066) 2015-12-21 02:45:22 +03:00
Boris Bobrov
f58fac0950 Fix typo in VideoData docstring 2015-12-20 21:38:56 +03:00
ayleph
6e38fec80e Fix Issue 5375 Deprecated function in video thumb
This patch fixes issue 5375 by replacing a function call that has
been removed in recent versions of PIL with the recommended
replacement.

(cherry picked from commit 564a48e018bcd786aa32b232cb7216be3ef3fb5e)
2015-12-20 00:51:13 +03:00
ayleph
564a48e018 Fix Issue 5375 Deprecated function in video thumb
This patch fixes issue 5375 by replacing a function call that has
been removed in recent versions of PIL with the recommended
replacement.
2015-12-20 00:47:02 +03:00
ayleph
e2b44bd7a7 Fix issue 983 PDF UnicodeDecodeError
Parse PDF lines as unicode to prevent UnicodeDecodeError when a
non-ASCII character is encountered.
2015-12-10 11:11:42 -06:00
ayleph
ba6d2d7e78 Fix for issue 5070 gst incomplete file
Seek tmp_media_file to 0 before attempting to discover the file type.
This prevents the following error when discovering mp4 video files.

"gst-stream-error-quark: This file is incomplete and cannot be played"
2015-11-19 16:05:25 -06:00
Jessica Tallon
0f3bf8d4b1 Collection changes and migration for federation
- Adds a "type" column to the Collection object and allows the
CollectionItem model to contain any object.
- Changes "items" to "num_items" as per TODO
- Renames "uploader", "creator" and "user" to a common "actor" in most places
2015-10-07 14:40:44 +02:00
Jessica Tallon
b4997540dc Fix some unit tests and bugs
This fixes a lot of the issues with the LocalUser changes that were
merged recently. There was a problem where the attributes of LocalUser
were not being eagerly loaded and because the Session was detached an
exception was being raised when they were accessed.

This also fixes some typo's which were introduced.

Finally this adds a temporary fix for a potential SQLAlchemy bug, this
is a bug where doing:

    User.query.filter(LocalUser.username == "some_username").first()

does NOT yeild a user with the username "some_username" but all users
on the site. The temp fix is to just query the LocalUser, this should
be resolved when bug is confirmed and fixed upstream.
2015-08-24 21:07:06 +02:00
Jessica Tallon
d88fcb03e2 Change codebase to query or create correct User model
The code base had many references to User.username and other
specific to LocalUser attributes as that was the way it use to exist.
This updates those to query on the generic User model but filtering
by attributes on the LocalUser.
2015-07-31 15:15:24 +02:00
Berker Peksag
cc92922386 Change all unicode() calls with six.text_type().
Fixes #5329.
2015-06-25 22:24:50 +03:00
Berker Peksag
896d00fbf2 Change all unicode() calls with six.text_type().
Fixes #5329.
2015-06-25 22:24:03 +03:00
Berker Peksag
2c1b0dc3e3 Fix typo. 2015-06-25 16:05:53 +03:00
Berker Peksag
8e4b1fab36 Fix more print statements. Refs #5331 2015-06-25 16:05:39 +03:00
Sebastian Spaeth
9051f99391 Fix print statements to be python3 compatible. Refs #5331 2015-06-25 16:05:26 +03:00
Berker Peksag
a17845d42e Fix typo. 2015-06-25 16:03:30 +03:00
Berker Peksag
790f31e275 Fix more print statements. Refs #5331 2015-06-25 16:00:18 +03:00
Sebastian Spaeth
fe124c8979 Fix print statements to be python3 compatible. Refs #5331 2015-06-25 16:00:18 +03:00
Christopher Allan Webber
5b8e0b2a63 Use of deprecated frombytes when processing videos causes the task to fail
(Anonymous contribution, not by me)

  When transcoding a video using a recent version of PIL transcoding a
  video fails reproducible. The reason for this is an AttributeError:
  'module' object has no attribute 'frombytes'gets raised, while a
  thumbnails is being created. This is because frombytes alias was
  deprecated in favor of fromstring.
2015-05-22 14:16:45 -05:00
Boris Bobrov
3510f94811 Move check that metadata exists earlier
Because of gstreamer-1.0 we need to migrate from old format of storing
metadata to new one. It seems that there are cases when original
metadata is empty for some reason.

The patch adds an earlier check that original metadata exists, skipping
everything is it doesn't.

Closes bug 5071
2015-04-23 11:48:23 -05:00
Boris Bobrov
364253857b fixed 5068 2015-04-22 17:20:31 -05:00
Boris Bobrov
4522ecef80 Proper handling of tags in skip_transcode
The function to retrieve tags was used incorrectly in skip_transcode,
assuming that str will be returned.

Now the code is aware of the return format of the function.

Closes bug 5065
2015-03-20 02:35:52 +03:00
Boris Bobrov
bd50f8bf70 Prevent exception on transcoding failure (bug 460)
Fix an unhandled exception when video fails to transcode for some
reason. Closes bug 460.
2015-03-20 01:53:18 +03:00
Jakob Kramer
f4686cde16 wtforms.fields.TextField was deprecated
WTForms documentation:
> The TextField alias for StringField is deprecated.

Signed-off-by: Berker Peksag <berker.peksag@gmail.com>
2015-03-12 21:57:53 +02:00
Christopher Allan Webber
fc3c8f21a0 Patch from breton: fix #5053 (gmg addmedia broken in 0.8.0) 2015-03-05 17:45:54 -06:00
Boris Bobrov
33055472f9 init GStreamer on demand only
Closes-Bug: 5024
2015-02-25 09:20:02 +03:00
Boris Bobrov
6e4eccb1d4 Missing codecs processing with gst 1.4
Gst 1.4 deprecated DiscovererInfo.get_misc in favour of
DiscovererInfo.get_missing_elements_installer_details. Something in
Python bindings seems to be broken and get_misc seems to be not
deprecated but broken.

The change makes sniffer use the method if get_misc fails.
2015-02-18 02:05:57 +03:00
Boris Bobrov
9834c876b7 added missing import to video transcoding 2015-02-16 13:41:21 +03:00
Boris Bobrov
2d1e89055d Added multiple a-v streams handling
Before only single video stream files were suported.

This patch adds support for files with multiple video streams. Metadata
of such files is now correctly stored. This required change of the
schema used to store info and the change is done in a migration.
2015-02-16 13:41:09 +03:00
Boris Bobrov
54b4b28f84 Add new hook for two-step media type checking
Before uploaded media files were checked by extension. This led to
situations when a plugin can support file with specific extension but
doesn't due to lack of codecs, for example. Since the plugin reported
that it supports uploaded file type, the upload was being declared
successful, but transcoding failed.

The failures were not easy to debug.

The change adds a new hook that could allow two-step checking of the
content. The result of the hook execution returns a tuple with
media type name, manager and a callable sniffer, that can be used to
perform probably expensive checks of the content.

Also the change adds implementation of the hook for video.
2015-02-16 13:41:09 +03:00