This commit closes #5

This commit is contained in:
Profitroll 2023-02-19 20:31:08 +01:00
parent 6b7b5c22f2
commit fd47217bad

View File

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