Skip to content

Commit

Permalink
Handle chars with the same name
Browse files Browse the repository at this point in the history
If characters have the same name previously the fetch would overwrite the same file over and over. This change adds the ID of the character into the filename to avoid this
  • Loading branch information
ryancollingwood authored Aug 15, 2023
1 parent 392f328 commit 192525d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def process_char(self, char_data: Dict, account_path: Path, attempt_num: int = 0
self.logger.info(f"fetching character id: {char_name} - {char_id}")
account_id: str = account_path.name

output_path: Path = (account_path / f"{char_name}.json")
output_path: Path = (account_path / f"{char_name}_{char_id}.json")
char_details_data: Dict[str, Any] = self.get_json(f'{self.base_url}/{account_id}/{char_id}')

if attempt_num < self.profile_queue_attempts:
Expand Down

0 comments on commit 192525d

Please sign in to comment.