dev #19

Merged
profitroll merged 98 commits from dev into master 2023-04-24 13:48:22 +03:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit b3698cfa70 - Show all commits

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, []

View File

@ -28,7 +28,7 @@ async def callback_query_yes(app: PosterClient, clb: CallbackQuery):
return
except SubmissionDuplicatesError as exp:
await clb.answer(text=locale("sub_duplicates_found", "callback", locale=user_locale), show_alert=True)
await clb.message.reply_text(locale("sub_media_duplicates_list", "message", locale=user_locale).format("\n".join(exp.duplicates)), quote=True)
await clb.message.reply_text(locale("sub_media_duplicates_list", "message", locale=user_locale).format("\n".join(exp.duplicates)), disable_web_page_preview=True, quote=True)
return
if submission is not None: