Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

Commit

Permalink
Fix count after upload while index link is none (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
anasty17 authored Jun 5, 2021
1 parent b709b8e commit d23bcbd
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions bot/modules/mirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ def onUploadProgress(self):
def onUploadComplete(self, link: str, size, files, folders, typ):
with download_dict_lock:
msg = f'<b>Filename: </b><code>{download_dict[self.uid].name()}</code>\n<b>Size: </b><code>{size}</code>'
if os.path.isdir(f'{DOWNLOAD_DIR}/{self.uid}/{download_dict[self.uid].name()}'):
msg += '\n\n<b>Type: </b>Folder'
msg += f'\n<b>SubFolders: </b>{folders}'
msg += f'\n<b>Files: </b>{files}'
else:
msg += f'\n\n<b>Type: </b>{typ}'
buttons = button_build.ButtonMaker()
if SHORTENER is not None and SHORTENER_API is not None:
surl = requests.get('https://{}/api?api={}&url={}&format=text'.format(SHORTENER, SHORTENER_API, link)).text
Expand All @@ -161,11 +167,6 @@ def onUploadComplete(self, link: str, size, files, folders, typ):
share_url = f'{INDEX_URL}/{url_path}'
if os.path.isdir(f'{DOWNLOAD_DIR}/{self.uid}/{download_dict[self.uid].name()}'):
share_url += '/'
msg += '\n\n<b>Type: </b>Folder'
msg += f'\n<b>SubFolders: </b>{folders}'
msg += f'\n<b>Files: </b>{files}'
else:
msg += f'\n\n<b>Type: </b>{typ}'
if SHORTENER is not None and SHORTENER_API is not None:
siurl = requests.get('https://{}/api?api={}&url={}&format=text'.format(SHORTENER, SHORTENER_API, share_url)).text
buttons.buildbutton("⚡Index Link⚡", siurl)
Expand Down

0 comments on commit d23bcbd

Please sign in to comment.