4227 Commits

Author SHA1 Message Date
Ben Sturmfels
2d941d21e1 Convert atom feeds to use feedgenerator library.
Issue is that Werkzeug > 1.0.0 has removed werkzeug.contrib.atom.AtomFeed,
making it difficult to use a distribution-packaged version of werkzeug. To solve
this, I've replaced use of werkzeug.contrib.atom.AtomFeed with
feedgenerator.Atom1Feed.

After the change, the only major difference between the feeds before and after is
that they use <summary> instead of <content>. Minor differences include no longer
adding 'type="text/html"' on some <link> elements and no "xml:base" attribute on
<entry> elements. I don't think these differences will have any noticable
effect.

Tested on Liferea feed reader.
2021-03-16 12:17:57 +11:00
Ben Sturmfels
83a744b1a2 Update version number, relnotes and upgrading docs in preparation for release. 2021-03-10 20:44:54 +11:00
Ben Sturmfels
9bd3ddb68a Note that download link sorting will be wrong for higher resolutions. 2021-03-09 22:47:53 +11:00
Ben Sturmfels
a25a6e3395 Update video links to support multiple resolution transcoding [#5620].
We may need to push download link creation into the view in the future to make
it more fully featured, but this will solve the immediate issue with missing
download links on new media after 0.10.0. Sorting of entries won't be right if
your media is over 999p since it's alphabetical.
2021-03-09 22:39:04 +11:00
Ben Sturmfels
3ba11716c1 Run LDAP, OpenID and PDF tests under Docker. 2021-03-09 16:56:28 +11:00
Ben Sturmfels
370d8a7296 More robust test fix. 2021-03-06 11:43:22 +11:00
Ben Sturmfels
f7a4dd1168 Fix broken metadata editing test. 2021-03-06 11:24:36 +11:00
Ben Sturmfels
f0d57e3bd8 Remove remaining Python 2 compatibility code. 2021-03-05 23:52:13 +11:00
Ben Sturmfels
9bf3bc1944 Remove remaining imports/calls to six not automatically removed by pyupgrade. 2021-03-05 23:42:38 +11:00
Ben Sturmfels
dec47c7102 Apply pyupgrade --py3-plus to remove Python 2 compatibility code. 2021-03-05 23:12:19 +11:00
Fernando Gutierrez
c2e93da0ce Reinstate audio spectrograms on Python 3 [#5610].
The `audiotospectrogram` module is a complete rewrite of the existing spectrogram
code with support for Python 3. This allows us to drop the bundled `freesound`
library and Python 2-only `audioprocessing` and `spectrogram` modules.

Signed-off-by: Ben Sturmfels <ben@sturm.com.au>
2021-03-03 22:21:11 +11:00
Ben Sturmfels
83429a8658 Drop Python 2 installation support. 2021-03-03 21:40:10 +11:00
Fernando Gutierrez
243354b65e
Avoid Celery/RabbitMQ "connection reset" errors [#5609].
This change starts Celery only after RabbitMQ is available. It also returns the
unnecessarily low BROKER_HEARTBEAT setting to default of 120.0 to help prevent
connections being reset on machines under load.
2020-05-12 12:30:35 +10:00
Ben Sturmfels
3d0c2a773b
Fix consistency in license list. 2020-05-11 23:47:33 +10:00
Ben Sturmfels
0e9e57ea30
Fix error generating Atom feed upon blank title [#1018]. 2020-05-11 23:38:59 +10:00
Ben Sturmfels
e94f94e639
fixup! Now in 0.11.0 development cycle. 2020-05-06 12:33:59 +10:00
Olivier Mehani
8bb15a5477
Make ldap plugin python3 compatible
Signed-off-by: Olivier Mehani <shtrom+mediagoblin@ssji.net>
2020-05-06 12:03:28 +10:00
Ben Sturmfels
74262351b7
Update version for release. 2020-05-04 13:11:48 +10:00
Ben Sturmfels
a9b7bd60b2
subtitles: Add documentation, limit uploads to *.vtt files, only show for video [#5589]. 2020-04-30 12:05:47 +10:00
Ben Sturmfels
e99f0aeac6
Add deprecation warning when running Python 2 [#5598]. 2020-04-29 14:10:01 +10:00
Ben Sturmfels
16fbe85247
Fix dependencies and tests for clean Python 2 & 3 test runs under Docker.
This change gives a clean test run in the Debian-based Python 2 and Python 3
docker images.
2020-04-28 18:23:24 +10:00
Ben Sturmfels
e3931333da
Revert "Use audio icon when spectrogram fails. Add note to doc:media-types."
This reverts commit 2b487fc16de2fc7c961f8df725c5ece0e5f56e3a.
2020-04-28 18:23:24 +10:00
Ben Sturmfels
632e973608
Revert "Fix Jorge's audio upload workaround in Python 3."
This reverts commit f1c288b1d87fed959a124816ef7a8fd40aec3dd3.
2020-04-28 18:23:24 +10:00
Ben Sturmfels
4f3f70d15a
Remove spectrograms from Python 2 also [#5594].
For 0.10.0 we're removing specrograms entirely for reliability. This change only
disables spectrograms and updates install docs and Dockerfiles. We still need
to strip out all the spectrogram code and extlib/freesound/.
2020-04-28 18:19:57 +10:00
Ben Sturmfels
4a150fa29e
Preparing to release 0.10. 2020-04-28 13:44:21 +10:00
Ben Sturmfels
a9aae9a059
Unmute videos by default.
Fixes #5590.
2020-04-24 15:24:33 +10:00
Ben Sturmfels
15c45a820f
Decode request.query_string before use.
Prior to this change, when pagination kicks in on the user management or report
management panel, the following exception is raised:

  TypeError: a bytes-like object is required, not 'str'

The cause is that `request.query_string` in the URL parameters in raw bytestring
form as per Werkzeug documentation.
2020-04-09 15:53:49 +10:00
Ben Sturmfels
f9112bd883
Revert "Decode request.query_string before use."
This reverts commit b6fba854007bb4392846085a60178c44dbd7989e.
2020-04-09 15:48:21 +10:00
Ben Sturmfels
b6fba85400
Decode request.query_string before use.
This doesn't seem to be an issue in my Guix SD/Python 3.7 testing, but hit an
issue on Debian 9/Python3.5 where concatenating text to `request.query_string`
was causing the error:

  TypeError: a bytes-like object is required, not 'str'

This clearly hasn't been an issue in the past though, so I suspect there's a
library somewhere that's on a different version and is behaving differently.
2020-04-09 15:29:51 +10:00
Ben Sturmfels
f1c288b1d8
Fix Jorge's audio upload workaround in Python 3.
Unfortunately now the player isn't showing up because there's no thumbnail.
2020-04-07 16:35:09 +10:00
Ben Sturmfels
882cd7ea3e
Note possible future steps for Python 3 audio thumbnailing. 2020-04-02 17:18:39 +11:00
Jorge
2b487fc16d
Use audio icon when spectrogram fails. Add note to doc:media-types.
In addition to side-stepping spectrograms completely in Python 3 in 1038aea8,
this commit adds some fallbacks that will help with potential issues in Python 2.

Fixes Issue #5457

Signed-off-by: Ben Sturmfels <ben@sturm.com.au>
Author: Jorge <mediagoblin@gybs.waa>
2020-04-02 16:58:11 +11:00
Muto
5252ef9f17
Add visual feedback on link hover
Signed-off-by: Ben Sturmfels <ben@sturm.com.au>
2020-04-02 13:57:16 +11:00
Ben Sturmfels
1038aea822
Fix audio thumbnailing once and for all.
This change adds a Python 3-specific audio thumbnailer that side-steps the
bundled Python 2-only `audioprocessing` module. Instead of an audio spectrogram,
Python 3 users will get a static image.

This also allows me to remove my ineffective customisations to
`audioprocessing`, returning it to the upstream version as should always be the
case for vendored code in "extlib".
2020-04-01 16:52:05 +11:00
Ben Sturmfels
ad3a0aea83
Handle moved SharedDataMiddleware in werkzeug >= 0.15.0. 2020-04-01 15:32:42 +11:00
Ben Sturmfels
c5a6bbdc88
Use items() for Python 3 support. 2019-11-27 22:30:19 +11:00
Ben Sturmfels
7075a065a2
Extend install instructions for raven plugin. 2019-11-27 22:14:52 +11:00
Ben Sturmfels
48208c278c
Prevent warning when importing GstPbutils.
Warning was:

PyGIWarning: GstPbutils was imported without specifying a version first. Use gi.require_version('GstPbutils', '1.0') before import to ensure that the right version gets loaded.
2019-11-01 16:41:45 +11:00
Olivier Mehani
d269b1a839
Add datetime_format config option.
Moves the datetime_format used in various places to the config and allows a
global override per site.

Signed-off-by: Ben Sturmfels <ben@sturm.com.au>
2019-09-20 10:38:09 +10:00
Ben Sturmfels
46ccfabcbe
metadata_display: Refine spacing. 2019-09-18 17:36:36 +10:00
Ben Sturmfels
2ca068851b
metadata_display: Improve default alignment/spacing of metadata. 2019-09-18 17:28:43 +10:00
Ben Sturmfels
b1d50f7beb
Even up top/bottom margins around header dropdown button.
Bottom margin was less than top margin.
2019-09-18 16:02:38 +10:00
Ben Sturmfels
c33168b3d8
Add basic duplicate prevention for batchaddmedia. 2019-09-18 15:58:24 +10:00
Ben Sturmfels
25bc7ea7f6
Update metadata_display plugin for Python 3.
Switching from iteritems() to items() is technically less memory efficient on
Python 2, but this appeared be a significantly cleaner approach than adding six
to the template context. It's also the right choice assuming the project will at
some point go Python 3 only.
2019-09-18 15:30:32 +10:00
Ben Sturmfels
8096beab5c
Add Python 3 docker-compose recipe for MediaGoblin hacking. 2019-09-16 18:08:57 +10:00
Ben Sturmfels
8f18381bbc
batchaddmedia: Simplify the Python 2 & 3 unicode handling.
To avoid issues with quotes, I've replaced the manual CSV handling with
csv.DictReader and simplified the unicode handling down to a single line. I
don't believe any special encoding is required when writing to the database.

This has been tested by importing a CSV with braille characters on Python 3 and
Python 2.
2019-09-12 19:39:54 +10:00
Ben Sturmfels
eb36543364
Remove unicode literals in batchaddmedia. 2019-09-12 15:41:36 +10:00
Ben Sturmfels
88ecf6a340
Fix URL-based importing with batchaddmedia command.
The command was raising "io.UnsupportedOperation: seek" for URL-based imports
and didn't support HTTPS.
2019-09-12 14:47:45 +10:00
Boris Bobrov
a65ffb4b69 Fix saving original of the video
Original of the video was not saved because info about it was not
written to the database. Fixed that.

Also removed original video from get_all_media listing. The method is
weird, we should evaluate whether it is video-specific and how to
generalize it.
2018-07-13 19:05:38 +02:00
Boris Bobrov
92a94f4e77 simplify an if and fix string formatting 2018-07-13 18:29:01 +02:00