From 65202189e10027770f6737c46ab0b87884150b5e Mon Sep 17 00:00:00 2001 From: Shyam Sunder Date: Sat, 21 Mar 2020 18:25:54 -0400 Subject: 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. --- server/szurubooru/api/post_api.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'server/szurubooru/api/post_api.py') diff --git a/server/szurubooru/api/post_api.py b/server/szurubooru/api/post_api.py index 8409484..09aea90 100644 --- a/server/szurubooru/api/post_api.py +++ b/server/szurubooru/api/post_api.py @@ -54,7 +54,9 @@ def create_post( source = ctx.get_param_as_string('contentUrl', default='') relations = ctx.get_param_as_int_list('relations', default=[]) notes = ctx.get_param_as_list('notes', default=[]) - flags = ctx.get_param_as_string_list('flags', default=[]) + flags = ctx.get_param_as_string_list( + 'flags', + default=posts.get_default_flags(content)) post, new_tags = posts.create_post( content, tag_names, None if anonymous else ctx.user) @@ -65,7 +67,6 @@ def create_post( posts.update_post_relations(post, relations) posts.update_post_notes(post, notes) posts.update_post_flags(post, flags) - posts.test_sound(post, content) if ctx.has_file('thumbnail'): posts.update_post_thumbnail(post, ctx.get_file('thumbnail')) ctx.session.add(post) -- cgit v1.3