From 3c5a0205a536984cc81d64c229c9f44e549415c6 Mon Sep 17 00:00:00 2001 From: Break27 Date: Thu, 27 Aug 2026 16:04:43 +0800 Subject: [PATCH] fix: task slicing range --- index.html | 2 +- main.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index c725e3c..283565f 100644 --- a/index.html +++ b/index.html @@ -258,7 +258,7 @@ async function handlePrimaryButtonClick() { if (options.slice) { start = $('#offset').valueAsNumber * $('#chunksize').valueAsNumber; - end = Math.min(minor || major, $('#chunksize').valueAsNumber); + end = Math.min(major, $('#chunksize').valueAsNumber); } await Rpc2.invoke('begin', { params: [options, parameters, start, end] }); diff --git a/main.py b/main.py index 2b277e5..a8a2e83 100644 --- a/main.py +++ b/main.py @@ -406,12 +406,12 @@ def main(driver: Chrome, logger = logging.getLogger('main')): raise Skip() if options.get('slice'): - if (items := options.get('subcategories')) and (item := str(cell(index, column.region).value)) not in items: - logger.info("[%d/%d] Value '%s' not enlisted; skipping '%s'", index-1, limit-1, item, email) - raise Next() if index < start or index >= start + end: logger.info("[%d/%d] Not planned; skipping '%s'", index-1, limit-1, email) raise Next() + if (items := options.get('subcategories')) and (item := str(cell(index, column.region).value)) not in items: + logger.info("[%d/%d] Value '%s' not enlisted; skipping '%s'", index-1, limit-1, item, email) + raise Next() if (sent := cell(index, column.sent).value) is not None and str(sent).strip(): logger.info("[%d/%d] Already visited; skipping '%s'", index-1, limit-1, email)