Ignore negative keep_tags values

This commit is contained in:
Gabriel Roldan 2023-09-20 19:50:34 -03:00
parent 43984f2ad3
commit 99a0431d0f
No known key found for this signature in database
GPG Key ID: 6FAD6D4A395EB862
1 changed files with 1 additions and 0 deletions

View File

@ -113,6 +113,7 @@ class ImageCaption:
@staticmethod
def __get_shuffled_tags(seed: int, tags: list[str], keep_tags: int) -> str:
tags = tags.copy()
keep_tags = min(keep_tags, 0)
if len(tags) > keep_tags:
fixed_tags = tags[:keep_tags]