Skip to content

Commit

Permalink
Fix #1323 (#1324)
Browse files Browse the repository at this point in the history
Move the bookmark_count casts out of the `else` scope
so that they can be casted even if in non-interactive mode

Co-authored-by: ensu <enrico.suarez@xsplit.com>
  • Loading branch information
nicodoggie and nicodoggie authored Feb 29, 2024
1 parent eace55a commit bcc25d9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions PixivUtil2.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,8 @@ def menu_download_by_tags(opisvalid, args, options):
else:
print("Valid values are 'a', 'i', or 'm'.")

if bookmark_count is not None and len(bookmark_count) > 0:
bookmark_count = int(bookmark_count)
if bookmark_count is not None and len(bookmark_count) > 0:
bookmark_count = int(bookmark_count)

PixivTagsHandler.process_tags(sys.modules[__name__],
__config__,
Expand Down Expand Up @@ -528,8 +528,8 @@ def menu_download_from_online_user_bookmark(opisvalid, args, options):
(start_page, end_page) = PixivHelper.get_start_and_end_number(total_number_of_page=options.number_of_pages)
bookmark_count = input('Bookmark Count: ').rstrip("\r") or None

if bookmark_count is not None and len(bookmark_count) > 0:
bookmark_count = int(bookmark_count)
if bookmark_count is not None and len(bookmark_count) > 0:
bookmark_count = int(bookmark_count)

PixivBookmarkHandler.process_bookmark(sys.modules[__name__],
__config__,
Expand Down Expand Up @@ -619,8 +619,8 @@ def menu_download_from_tags_list(opisvalid, args, options):
(page, end_page) = PixivHelper.get_start_and_end_number(total_number_of_page=options.number_of_pages)
(start_date, end_date) = PixivHelper.get_start_and_end_date()

if bookmark_count is not None and len(bookmark_count) > 0:
bookmark_count = int(bookmark_count)
if bookmark_count is not None and len(bookmark_count) > 0:
bookmark_count = int(bookmark_count)

PixivListHandler.process_tags_list(sys.modules[__name__],
__config__,
Expand All @@ -645,8 +645,8 @@ def menu_download_new_illust_from_bookmark(opisvalid, args, options):
(page_num, end_page_num) = PixivHelper.get_start_and_end_number(total_number_of_page=options.number_of_pages)
bookmark_count = input('Bookmark Count: ').rstrip("\r") or None

if bookmark_count is not None and len(bookmark_count) > 0:
bookmark_count = int(bookmark_count)
if bookmark_count is not None and len(bookmark_count) > 0:
bookmark_count = int(bookmark_count)

PixivBookmarkHandler.process_new_illust_from_bookmark(sys.modules[__name__],
__config__,
Expand Down

0 comments on commit bcc25d9

Please sign in to comment.