Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions templesync.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def temple_player_data(username: str):
used_id.add(item['id'])
cleaned_player_data.append(item)

return player_data
return cleaned_player_data


def read_json_file(file_path):
Expand Down Expand Up @@ -41,7 +41,9 @@ def import_logs(player_name: str, site_tasks: list):

def check_logs(username: str, site_tasks: list, action: str):
def find_by_id(items, target_id):
return [item for item in items if item['id'] == target_id]
print(type(target_id))

return [item for item in items if int(item['id']) == target_id]
def format_completed_tasks(completed_tasks: set):
# iterate over the completed tasks and create a list of dictionaries
formatted_tasks = []
Expand All @@ -52,6 +54,7 @@ def format_completed_tasks(completed_tasks: set):
return formatted_tasks

cleaned_player_data = temple_player_data(username)
print(type(cleaned_player_data))
missing_tasks = list()
completed_tasks = set()
for task in site_tasks:
Expand Down Expand Up @@ -79,5 +82,6 @@ def format_completed_tasks(completed_tasks: set):
print(task)
return missing_tasks
else:
print(completed_tasks)
return format_completed_tasks(completed_tasks)
sorted_completed_tasks = sorted(completed_tasks)
print(sorted_completed_tasks)
return format_completed_tasks(sorted_completed_tasks)