Skip to content
/ Aeon-MLTB Public template
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: status page and update #166

Merged
merged 17 commits into from
Jan 26, 2025
Prev Previous commit
Next Next commit
minor fix
5hojib committed Jan 26, 2025
commit fac2df8fbf7e890fda3b143ce3a3326ccd0834d9
2 changes: 2 additions & 0 deletions bot/helper/ext_utils/status_utils.py
Original file line number Diff line number Diff line change
@@ -256,6 +256,8 @@ async def get_readable_message(sid, is_user, page_no=1, status="All", page_step=
if status != "All" or tasks_no > 20:
for label, status_value in list(STATUSES.items()):
if status_value != status:
if not buttons:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Initialize 'buttons' variable before the loop to prevent potential UnboundLocalError

The buttons variable should be initialized before the loop to ensure it exists when the condition is checked.

buttons = ButtonMaker()
buttons.data_button(label, f"status {sid} st {status_value}")
button = buttons.build_menu(8) if buttons else None
msg += f"<b>CPU:</b> {cpu_percent()}% | <b>FREE:</b> {get_readable_file_size(disk_usage(Config.DOWNLOAD_DIR).free)}"
13 changes: 6 additions & 7 deletions bot/modules/mirror_leech.py
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@
is_gdrive_id,
is_gdrive_link,
is_magnet,
# is_mega_link,
is_mega_link,
is_rclone_path,
is_telegram_link,
is_url,
@@ -36,10 +36,9 @@
direct_link_generator,
)
from bot.helper.mirror_leech_utils.download_utils.gd_download import add_gd_download

# from bot.helper.mirror_leech_utils.download_utils.mega_download import (
# add_mega_download,
# )
from bot.helper.mirror_leech_utils.download_utils.mega_download import (
add_mega_download,
)
from bot.helper.mirror_leech_utils.download_utils.qbit_download import add_qb_torrent
from bot.helper.mirror_leech_utils.download_utils.rclone_download import (
add_rclone_download,
@@ -387,8 +386,8 @@ async def new_event(self):
create_task(add_qb_torrent(self, path, ratio, seed_time))
elif is_rclone_path(self.link):
create_task(add_rclone_download(self, f"{path}/"))
# elif is_mega_link(self.link):
# create_task(add_mega_download(self, f"{path}/"))
elif is_mega_link(self.link):
create_task(add_mega_download(self, f"{path}/"))
elif is_gdrive_link(self.link) or is_gdrive_id(self.link):
create_task(add_gd_download(self, path))
else:
5 changes: 1 addition & 4 deletions update.py
Original file line number Diff line number Diff line change
@@ -106,10 +106,7 @@ def format(self, record: LogRecord) -> str:
except Exception as e:
log_error(f"Database ERROR: {e}")

UPSTREAM_REPO = config_file.get(
"UPSTREAM_REPO",
"https://github.com/AeonOrg/Aeon-MLTB",
) or os.getenv("UPSTREAM_REPO", "")
UPSTREAM_REPO = config_file.get("UPSTREAM_REPO", "") or os.getenv("UPSTREAM_REPO", "") or "https://github.com/AeonOrg/Aeon-MLTB"

UPSTREAM_BRANCH = (
config_file.get("UPSTREAM_BRANCH", "")