Compare commits

..

6 Commits

View File

@@ -49,6 +49,7 @@ def db_update():
logger.info(f"{Fore.YELLOW}Обновление Тегов...\n{Fore.RESET}")
clock_tags = clock.get_tags(is_updating=True, **{"page-size": clock.tags_count})
if clock_tags:
db_tags = db.get_tags()
new_tags = [tag for tag in clock_tags if tag not in db_tags]
@@ -65,8 +66,9 @@ def db_update():
# Обновление Задач
logger.info(f"{Fore.YELLOW}Обновление Задач...\n{Fore.RESET}")
db_tasks = db.get_tasks()
red_tasks = red.get_issues()
if red_tasks:
db_tasks = db.get_tasks()
clock_tasks = [task for task in red_tasks if task.id in [parse_task_id(tag.title) for tag in [*db_tags, *new_tags]]]
new_tasks = [task for task in clock_tasks if task not in db_tasks]
@@ -82,6 +84,7 @@ def db_update():
# Обновление Проектов Ветро
logger.info(f"{Fore.YELLOW}Обновление Проектов Ветро{Fore.RESET}")
clock_projects = clock.get_vetro_projects()
if clock_projects:
db_projects = db.get_vetro_projects()
new_projects = [project for project in clock_projects if project not in db_projects]
@@ -97,6 +100,7 @@ def db_update():
# Обновление Типов деятельности
logger.info(f"{Fore.YELLOW}Обновление Типов деятельности{Fore.RESET}")
red_types = red.get_time_entry_activities()
if red_types:
db_types = db.get_activity_types()
new_types = [type_ for type_ in red_types if type_ not in db_types]