No need for buttons if only 1 page
Signed-off-by: anas <e.anastayyar@gmail.com>
This commit is contained in:
parent
dcdbbccb68
commit
6f85fdc6ea
|
|
@ -138,18 +138,18 @@ def get_readable_message():
|
||||||
msg += f"\n<b>To Stop:</b> <code>/{BotCommands.CancelMirror} {download.gid()}</code>"
|
msg += f"\n<b>To Stop:</b> <code>/{BotCommands.CancelMirror} {download.gid()}</code>"
|
||||||
msg += "\n\n"
|
msg += "\n\n"
|
||||||
if STATUS_LIMIT is not None:
|
if STATUS_LIMIT is not None:
|
||||||
limit = COUNT + STATUS_LIMIT
|
if INDEX >= COUNT + STATUS_LIMIT:
|
||||||
if INDEX >= limit:
|
|
||||||
break
|
break
|
||||||
if STATUS_LIMIT is not None:
|
if STATUS_LIMIT is not None:
|
||||||
if INDEX > limit:
|
if INDEX > COUNT + STATUS_LIMIT:
|
||||||
return None, None
|
return None, None
|
||||||
msg += f"Page: {PAGE_NO}/{pages} | Tasks: {dick_no}\n"
|
if dick_no > STATUS_LIMIT:
|
||||||
buttons = button_build.ButtonMaker()
|
msg += f"Page: {PAGE_NO}/{pages} | Tasks: {dick_no}\n"
|
||||||
buttons.sbutton("Previous", "pre")
|
buttons = button_build.ButtonMaker()
|
||||||
buttons.sbutton("Next", "nex")
|
buttons.sbutton("Previous", "pre")
|
||||||
button = InlineKeyboardMarkup(buttons.build_menu(2))
|
buttons.sbutton("Next", "nex")
|
||||||
return msg, button
|
button = InlineKeyboardMarkup(buttons.build_menu(2))
|
||||||
|
return msg, button
|
||||||
return msg, ""
|
return msg, ""
|
||||||
|
|
||||||
def flip(update, context):
|
def flip(update, context):
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ class AriaDownloadHelper(DownloadHelper):
|
||||||
dl.getListener().onDownloadError(f'{mssg}.\nYour File/Folder size is {get_readable_file_size(size)}')
|
dl.getListener().onDownloadError(f'{mssg}.\nYour File/Folder size is {get_readable_file_size(size)}')
|
||||||
aria2.remove([download], force=True)
|
aria2.remove([download], force=True)
|
||||||
return
|
return
|
||||||
update_all_messages()
|
update_all_messages()
|
||||||
|
|
||||||
def __onDownloadComplete(self, api: API, gid):
|
def __onDownloadComplete(self, api: API, gid):
|
||||||
dl = getDownloadByGid(gid)
|
dl = getDownloadByGid(gid)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue