Skip to content

Commit

Permalink
Auto-format code [skip actions]
Browse files Browse the repository at this point in the history
  • Loading branch information
5hojib committed Dec 23, 2024
1 parent 4d3f2e0 commit c021109
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
3 changes: 2 additions & 1 deletion bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,8 @@ def format(self, record: LogRecord) -> str:
if ospath.exists("accounts"):
rmtree("accounts")
subprocess.run(
["7z", "x", "-o.", "-aoa", "accounts.zip", "accounts/*.json"], check=False
["7z", "x", "-o.", "-aoa", "accounts.zip", "accounts/*.json"],
check=False,
)
subprocess.run(["chmod", "-R", "777", "accounts"], check=False)
remove("accounts.zip")
Expand Down
18 changes: 10 additions & 8 deletions bot/helper/listeners/qbit_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,16 @@ async def _on_seed_finish(tor):

@new_task
async def _stop_duplicate(tor):
if (task := await get_task_by_gid(tor.hash[:12])) and task.listener.stop_duplicate:
task.listener.name = tor.content_path.rsplit("/", 1)[-1].rsplit(
".!qB",
1,
)[0]
msg, button = await stop_duplicate_check(task.listener)
if msg:
_on_download_error(msg, tor, button)
if (
task := await get_task_by_gid(tor.hash[:12])
) and task.listener.stop_duplicate:
task.listener.name = tor.content_path.rsplit("/", 1)[-1].rsplit(
".!qB",
1,
)[0]
msg, button = await stop_duplicate_check(task.listener)
if msg:
_on_download_error(msg, tor, button)


@new_task
Expand Down
7 changes: 5 additions & 2 deletions web/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ def make_tree(res, tool=False):
else:
previous_node = current_node
try:
progress = round((int(i["completedLength"]) / int(i["length"])) * 100, 5)
progress = round(
(int(i["completedLength"]) / int(i["length"])) * 100, 5
)
except:
progress = 0
TorNode(
Expand All @@ -126,7 +128,8 @@ def make_tree(res, tool=False):
else:
try:
progress = round(
(int(i["completedLength"]) / int(i["length"])) * 100, 5
(int(i["completedLength"]) / int(i["length"])) * 100,
5,
)
except:
progress = 0
Expand Down

0 comments on commit c021109

Please sign in to comment.