Bob Mottram 2023-01-25 12:38:34 +00:00
commit dceea5eec1
2 changed files with 8 additions and 17 deletions

View File

@ -722,7 +722,7 @@ def _command_options() -> None:
default=None,
help='Remove a filter on a particular word or phrase')
parser.add_argument('--domainmax', dest='domain_max_posts_per_day',
type=int, default=8640,
type=int, default=16000,
help='Maximum number of received posts ' +
'from a domain per day')
parser.add_argument('--accountmax', dest='account_max_posts_per_day',

View File

@ -1292,7 +1292,7 @@ def get_post_attachments_as_html(base_dir: str,
gallery_str += '<div class="gallery">\n'
if not is_muted:
gallery_str += ' <a href="' + image_url + '">\n'
if media_license or media_creator:
if media_license and media_creator:
gallery_str += ' <figure>\n'
gallery_str += \
' <img loading="lazy" ' + \
@ -1300,7 +1300,7 @@ def get_post_attachments_as_html(base_dir: str,
image_url + '" alt="" title="">\n'
gallery_str += ' </a>\n'
license_str = ''
if media_license:
if media_license and media_creator:
if '://' in media_license:
license_str += \
'<a href="' + media_license + \
@ -1308,11 +1308,7 @@ def get_post_attachments_as_html(base_dir: str,
'rel="nofollow noopener noreferrer">©</a>'
else:
license_str += media_license
if media_creator:
if license_str:
license_str += ' '
license_str += media_creator
if media_license or media_creator:
license_str += ' ' + media_creator
gallery_str += \
' ' + license_str + \
'</figcaption></figure>\n'
@ -1378,17 +1374,16 @@ def get_post_attachments_as_html(base_dir: str,
'<div id="' + post_id + '">\n'
attachment_str += '<a href="' + image_url + '" tabindex="10">'
if media_license or media_creator:
if media_license and media_creator:
attachment_str += '<figure>'
attachment_str += \
'<img loading="lazy" decoding="async" ' + \
'src="' + image_url + \
'" alt="' + image_description + '" title="' + \
image_description + '" class="attachment"></a>\n'
if media_license or media_creator:
attachment_str += '<figcaption>'
if media_license and media_creator:
license_str = ''
if media_license:
attachment_str += '<figcaption>'
if '://' in media_license:
license_str += \
'<a href="' + media_license + \
@ -1396,11 +1391,7 @@ def get_post_attachments_as_html(base_dir: str,
'rel="nofollow noopener noreferrer">©</a>'
else:
license_str += media_license
if media_creator:
if license_str:
license_str += ' '
license_str += media_creator
if media_license or media_creator:
license_str += ' ' + media_creator
attachment_str += license_str + '</figcaption></figure>'
if minimize_images: