mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-04-23 11:52:34 +08:00
Fix: Same task with different next_run will not switch (#785)
This commit is contained in:
@@ -28,6 +28,15 @@ class Function:
|
|||||||
|
|
||||||
__repr__ = __str__
|
__repr__ = __str__
|
||||||
|
|
||||||
|
def __eq__(self, other):
|
||||||
|
if not isinstance(other, Function):
|
||||||
|
return False
|
||||||
|
|
||||||
|
if self.command == other.command and self.next_run == other.next_run:
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def name_to_function(name):
|
def name_to_function(name):
|
||||||
"""
|
"""
|
||||||
@@ -337,14 +346,15 @@ class AzurLaneConfig(ConfigUpdater, ManualConfig, GeneratedConfig):
|
|||||||
Raises:
|
Raises:
|
||||||
bool: If task switched
|
bool: If task switched
|
||||||
"""
|
"""
|
||||||
prev = self.task.command
|
prev = self.task
|
||||||
self.load()
|
self.load()
|
||||||
new = self.get_next().command
|
new = self.get_next()
|
||||||
if prev != new:
|
if prev == new:
|
||||||
|
logger.info(f'Continue task `{new}`')
|
||||||
|
return False
|
||||||
|
else:
|
||||||
logger.info(f'Switch task `{prev}` to `{new}`')
|
logger.info(f'Switch task `{prev}` to `{new}`')
|
||||||
return True
|
return True
|
||||||
else:
|
|
||||||
return False
|
|
||||||
|
|
||||||
def check_task_switch(self, message=''):
|
def check_task_switch(self, message=''):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user