mirror of
				https://git.webmeisterei.com/webmeisterei/todoist-taskwarrior.git
				synced 2025-10-31 10:02:42 +01:00 
			
		
		
		
	Skip task before trying to parse recur if it already exists
This commit is contained in:
		| @@ -115,6 +115,12 @@ def migrate(ctx, interactive, sync, map_project, map_tag): | |||||||
|         tid = data['tid'] = task['id'] |         tid = data['tid'] = task['id'] | ||||||
|         name = data['name'] = task['content'] |         name = data['name'] = task['content'] | ||||||
|  |  | ||||||
|  |         # Log message and check if exists | ||||||
|  |         io.important(f'Task {idx + 1} of {len(tasks)}: {name}') | ||||||
|  |         if check_task_exists(tid): | ||||||
|  |             io.info(f'Already exists (todoist_id={tid})') | ||||||
|  |             continue | ||||||
|  |  | ||||||
|         # Project |         # Project | ||||||
|         p = todoist.projects.get_by_id(task['project_id']) |         p = todoist.projects.get_by_id(task['project_id']) | ||||||
|         project_hierarchy = [p] |         project_hierarchy = [p] | ||||||
| @@ -143,11 +149,7 @@ def migrate(ctx, interactive, sync, map_project, map_tag): | |||||||
|         data['due'] = utils.parse_date(task['due_date_utc']) |         data['due'] = utils.parse_date(task['due_date_utc']) | ||||||
|         data['recur'] = parse_recur_or_prompt(task['date_string']) |         data['recur'] = parse_recur_or_prompt(task['date_string']) | ||||||
|  |  | ||||||
|         io.important(f'Task {idx + 1} of {len(tasks)}: {name}') |         if not interactive: | ||||||
|  |  | ||||||
|         if check_task_exists(tid): |  | ||||||
|             io.info(f'Already exists (todoist_id={tid})') |  | ||||||
|         elif not interactive: |  | ||||||
|             add_task(**data) |             add_task(**data) | ||||||
|         else: |         else: | ||||||
|             add_task_interactive(**data) |             add_task_interactive(**data) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Matt Snider
					Matt Snider