mirror of https://gitlab.com/bashrc2/epicyon
Get and set dithering image flag
parent
3e304dca55
commit
7dbdcc37c8
|
|
@ -2139,10 +2139,20 @@ def _receive_new_post_process(self, post_type: str, path: str, headers: {},
|
||||||
comments_enabled: bool = False
|
comments_enabled: bool = False
|
||||||
else:
|
else:
|
||||||
comments_enabled: bool = True
|
comments_enabled: bool = True
|
||||||
|
|
||||||
|
# update the image dithering flag
|
||||||
|
dither_filename = \
|
||||||
|
acct_dir(base_dir, nickname, domain) + '/.ditherImage'
|
||||||
if not fields.get('ditherImage'):
|
if not fields.get('ditherImage'):
|
||||||
apply_dithering: bool = False
|
apply_dithering: bool = False
|
||||||
|
if is_a_file(dither_filename):
|
||||||
|
erase_file(dither_filename,
|
||||||
|
'EX: unable to delete dither flag ' + dither_filename)
|
||||||
else:
|
else:
|
||||||
apply_dithering: bool = True
|
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 = ''
|
buy_url: str = ''
|
||||||
if fields.get('buyUrl'):
|
if fields.get('buyUrl'):
|
||||||
|
|
|
||||||
13
src/posts.py
13
src/posts.py
|
|
@ -2057,19 +2057,6 @@ def create_post_base(base_dir: str,
|
||||||
automatic_quote_approval,
|
automatic_quote_approval,
|
||||||
session, debug)
|
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_mentions(cc_url, new_post, to_recipients, tags)
|
||||||
|
|
||||||
_create_post_mod_report(base_dir, is_moderation_report,
|
_create_post_mod_report(base_dir, is_moderation_report,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue