Added support for duplicates access tokens

This commit is contained in:
Profitroll
2023-02-18 00:55:58 +01:00
parent 7607003f55
commit b3698cfa70
2 changed files with 3 additions and 3 deletions

View File

@@ -63,8 +63,8 @@ async def upload_pic(filepath: str, token: Union[str, None] = None) -> Tuple[boo
raise SubmissionUploadError(str(filepath), response.status_code, response.content)
duplicates = []
if "duplicates" in response.json():
for duplicate in response.json()["duplicates"]:
duplicates.append(f'{configGet("address_external", "posting", "api")}/photos/{duplicate["id"]}')
for index, duplicate in enumerate(response.json()["duplicates"]):
duplicates.append(f'`{duplicate["id"]}`:\n{configGet("address_external", "posting", "api")}/token/photo/{response.json()["access_token"]}?id={index}')
return True, duplicates
except:
return False, []