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) raise SubmissionUploadError(str(filepath), response.status_code, response.content)
duplicates = [] duplicates = []
if "duplicates" in response.json(): if "duplicates" in response.json():
for duplicate in response.json()["duplicates"]: for index, duplicate in enumerate(response.json()["duplicates"]):
duplicates.append(f'{configGet("address_external", "posting", "api")}/photos/{duplicate["id"]}') 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:
return False, [] return False, []

View File

@ -28,7 +28,7 @@ async def callback_query_yes(app: PosterClient, clb: CallbackQuery):
return return
except SubmissionDuplicatesError as exp: except SubmissionDuplicatesError as exp:
await clb.answer(text=locale("sub_duplicates_found", "callback", locale=user_locale), show_alert=True) 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 return
if submission is not None: if submission is not None: