Commit graph

48 commits

Author SHA1 Message Date
Shyam Sunder
0dd427755b client+server: fix linter issues due to updated pre-commit hooks 2020-09-01 14:07:39 -04:00
Shyam Sunder
57193b5715 client+server: implement code autoformatting using prettier and black 2020-06-06 08:58:23 -04:00
Shyam Sunder
99a69333e6 server/posts/upload: Add youtube-dl functionality
allows for video-based posts to be created by using youtube-dl
on the server. Access is controlled with the 'uploads:use_downloader'
permission.
2020-04-03 13:11:54 -04:00
Shyam Sunder
65202189e1 server/posts/upload: edit default flag behavior
The 'loop' flag will be auto-selected by default on video posts if
the flags parameter is undefined when creating a new post.
2020-03-21 18:25:54 -04:00
Shyam Sunder
4c78cf8c47 server/image_search: implement reverse search functionality in postgres
This will remove the dependency on the Elasticsearch database.

The search query is passed currently as raw SQL. Proper implementation
using SQLAlchemy will need custom ORM classed to be made.

Additional config parameter "allow_broken_uploads" has been added.
2020-03-13 22:45:11 -04:00
Shyam Sunder
8a10fc8ffd server/posts: automatically detect sound in video post uploads 2018-09-24 11:36:13 +02:00
ReAnzu
12ec43f098 server/posts: auto convert GIFs to WEBMs/MP4s
- Default setting is false for both conversions, as this will require
  additional resources of the server, but is bandwidth friendly for
  viewers
- WEBM conversion is slow, but better quality than MP4 conversion with
  a typically smaller file size
- Tags are copied over from the original upload
- Snapshots are generated for the new auto posts
2018-03-08 07:48:45 +01:00
rr-
1c4c5c5f91 remove tags.json 2017-10-01 21:48:00 +02:00
rr-
674d6c35d7 server/posts: add posts:view:featured privilege 2017-08-24 17:17:09 +02:00
rr-
4bc58a3c95 server: lint 2017-04-24 23:30:53 +02:00
rr-
e725f4f99c server/api: extra validation of list fields 2017-02-05 16:34:45 +01:00
rr-
ad842ee8a5 server: refactor + add type hinting
- Added type hinting (for now, 3.5-compatible)
- Split `db` namespace into `db` module and `model` namespace
- Changed elastic search to be created lazily for each operation
- Changed to class based approach in entity serialization to allow
  stronger typing
- Removed `required` argument from `context.get_*` family of functions;
  now it's implied if `default` argument is omitted
- Changed `unalias_dict` implementation to use less magic inputs
2017-02-05 16:34:45 +01:00
rr-
aa1faa3ccb server/image-hash: improve exception handling 2017-02-02 19:46:03 +01:00
rr-
4cb613a5c9 server/posts: change reverse image search API
Add exact duplicates search; refactor to use classes over dictionaries
2017-01-07 14:07:31 +01:00
rr-
a7a5cc8180 server/posts: expose reverse image search 2016-12-26 15:00:16 +01:00
rr-
e71718c50d server/posts: add replaceContent to post merging 2016-10-21 22:34:45 +02:00
rr-
9d6a0e0173 server/posts: add post merging 2016-10-21 21:48:38 +02:00
rr-
ffb87f1650 server/posts: defer flush; save content lazily
Rather than flushing the post right away only to find out that there
were validation errors, try to postpone flushing for as long as
possible.

The previous behavior has led to too eager spending of post IDs - each
flush calls nextval(post_id_seq), and postgres sequences are not
affected by transaction rollbacks, so each erroneous post creation
discarded a post ID, which has led to gaps in post IDs.
2016-08-26 15:09:08 +02:00
rr-
73a8542220 server/posts: make anon snapshots for anon uploads 2016-08-22 20:07:39 +02:00
rr-
b7e9cbd541 server/posts: allow tagless posts 2016-08-21 23:40:01 +02:00
rr-
80af79779d server/snapshots: rewrite 2016-08-16 21:51:25 +02:00
rr-
0320a0b55b server/general: improve versioning effectiveness
...by integrating it with sqlalchemy that adds WHERE conditions for each
UPDATE and DELETE statement.
2016-08-16 17:22:33 +02:00
rr-
9aea55e3d1 server/general: embrace most of PEP8
Ignored only the rules about continuing / hanging indentation.

Also, added __init__.py to tests so that pylint discovers them. (I don't
buy pytest's BS about installing your package.)
2016-08-14 16:44:03 +02:00
rr-
af62f8c45a server/general: ditch falcon for in-house WSGI app
For quite some time, I hated Falcon's class maps approach that caused
more chaos than good for Szurubooru. I've taken a look at the other
frameworks (hug, flask, etc) again, but they all looked too
bloated/over-engineered. I decided to just talk to WSGI myself.

Regex-based routing may not be the fastest in the world, but I'm fine
with response time of 10 ms for cached /posts.
2016-08-14 16:43:35 +02:00
rr-
8d04df38fd server/general: add entity versions 2016-08-07 09:55:51 +02:00
rr-
5092c2c587 server/posts: respect tag creating privilege 2016-08-02 12:44:38 +02:00
rr-
ff189a3915 server/posts: fix deleting post with comments 2016-08-02 12:27:01 +02:00
rr-
ac23067fdf server/general: use UTC time stamps 2016-07-03 14:46:28 +02:00
rr-
dfb2e3d027 server/posts: add getting posts around id
Leave undocumented since it add almost no value for the client
applications.
2016-06-08 22:38:35 +02:00
rr-
508cb6e7ab server/posts: allow anonymous uploads (#90) 2016-06-05 10:30:10 +02:00
rr-
59ad5fe402 server/search: refactor, extract parsing 2016-06-03 19:47:09 +02:00
rr-
037fbc61ec server/api: add ability to select fields 2016-05-30 23:08:22 +02:00
rr-
8d1e23aa63 server/general: flatten responses 2016-05-30 22:54:33 +02:00
rr-
d0314813cb server/general: move extra details to resources 2016-05-30 22:54:33 +02:00
rr-
58964bcdc9 server/posts: add post listing 2016-05-07 21:50:37 +02:00
rr-
9b591c3f1b server/posts: remember source for URL content 2016-05-05 13:46:57 +02:00
rr-
e632324f72 server/posts: add post updating 2016-05-02 21:58:13 +02:00
rr-
ce095816d9 server/posts: add post creating 2016-05-02 00:07:33 +02:00
rr-
a567974784 server/general: refactor method names 2016-04-30 23:54:05 +02:00
rr-
83cc7a568d server/posts: add post (un)favoriting 2016-04-28 19:04:44 +02:00
rr-
0b20132a2f server/api + docs/api: organize responses 2016-04-28 18:20:50 +02:00
rr-
2b69e9b461 server/posts: add post deleting 2016-04-27 19:24:50 +02:00
rr-
587a8f8276 server/posts: add post retrieving 2016-04-25 10:48:15 +02:00
rr-
52f4018bee server/comments+posts: add rating 2016-04-24 16:37:11 +02:00
rr-
8fb536c8f0 server/general: move not found errors to func 2016-04-24 14:34:01 +02:00
rr-
6e6c57d44a server/api: move serializers to func layer 2016-04-24 10:31:49 +02:00
rr-
1476c84a9d server/posts: add featured post retrieval 2016-04-23 08:07:21 +02:00
rr-
cf00a3a2de server/posts: add post featuring 2016-04-22 20:58:04 +02:00