Get and set dithering image flag

main
bashrc 2026-07-26 18:09:24 +01:00
parent 3e304dca55
commit 7dbdcc37c8
2 changed files with 10 additions and 13 deletions

View File

@ -2139,10 +2139,20 @@ def _receive_new_post_process(self, post_type: str, path: str, headers: {},
comments_enabled: bool = False
else:
comments_enabled: bool = True
# update the image dithering flag
dither_filename = \
acct_dir(base_dir, nickname, domain) + '/.ditherImage'
if not fields.get('ditherImage'):
apply_dithering: bool = False
if is_a_file(dither_filename):
erase_file(dither_filename,
'EX: unable to delete dither flag ' + dither_filename)
else:
apply_dithering: bool = True
if not is_a_file(dither_filename):
save_string('.', dither_filename,
'EX: unable to save dither flag ' + dither_filename)
buy_url: str = ''
if fields.get('buyUrl'):

View File

@ -2057,19 +2057,6 @@ def create_post_base(base_dir: str,
automatic_quote_approval,
session, debug)
# update the image dithering flag
dither_filename = \
acct_dir(base_dir, nickname, domain) + '/.ditherImage'
if apply_dithering:
if not is_a_file(dither_filename):
save_string('.', dither_filename,
'EX: unable to save ditherImage flag ' +
dither_filename)
else:
if is_a_file(dither_filename):
erase_file(dither_filename,
'EX: unable to delete ' + dither_filename)
_create_post_mentions(cc_url, new_post, to_recipients, tags)
_create_post_mod_report(base_dir, is_moderation_report,