dev #19

Merged
profitroll merged 98 commits from dev into master 2023-04-24 13:48:22 +03:00
Showing only changes of commit fd47217bad - Show all commits

View File

@ -64,7 +64,10 @@ async def upload_pic(filepath: str, token: Union[str, None] = None) -> Tuple[boo
duplicates = []
if "duplicates" in response.json():
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}')
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}')
return True, duplicates
except:
return False, []