1
1
mirror of https://github.com/KenanZhu/AutoLibrary.git synced 2026-06-18 07:23:03 +08:00

Compare commits

...

2 Commits

Author SHA1 Message Date
KenanZhu a8789ad743 fix(LibReserve): fix the failure to select nearest reserve time when the max time difference is 0
The previous implementation only considered the case when more than one nearest time exists,
so we introduced the prefer_early flag to decide which one to be selected.But the comparsion
mistakenly omitted the edge case when the difference is 0.
2025-11-06 20:07:43 +08:00
KenanZhu bf106ea234 fix(AutoLib): fix the missed user counter while running the task 2025-11-06 20:07:43 +08:00
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -203,6 +203,7 @@ class AutoLib(MsgBase):
f"用户配置文件路径: {self.__users_config_reader.configPath()}")
for user in users:
user_counter["current"] += 1
self._showTrace(f"正在处理第 {user_counter["current"]}/{len(users)} 个用户: {user['username']}......")
if self.__run(
username=user["username"],
+2 -2
View File
@@ -403,9 +403,9 @@ class LibReserve(LibOperator):
if abs_diff < best_time_diff or (
abs_diff == best_time_diff and (
# prefer earlier time
(prefer_earlier and actual_diff < 0) or
(prefer_earlier and actual_diff <= 0) or
# prefer later time
(not prefer_earlier and actual_diff > 0)
(not prefer_earlier and actual_diff >= 0)
)
):
best_time_diff = abs_diff