mirror of
https://codeberg.org/hyperreal/admin-scripts
synced 2024-11-25 09:03:41 +01:00
refactor
This commit is contained in:
parent
13a4ac5a79
commit
87f7018acf
14
bin/qbth.py
14
bin/qbth.py
@ -70,9 +70,9 @@ def remove_torrents(distro_substring: str):
|
|||||||
torrent's file name.
|
torrent's file name.
|
||||||
"""
|
"""
|
||||||
for torrent in qb.torrents():
|
for torrent in qb.torrents():
|
||||||
if distro_substring in torrent.get("name"): # type: ignore
|
if distro_substring in torrent.get("name"): # type: ignore
|
||||||
qb.delete_permanently(torrent.get("hash")) # type: ignore
|
qb.delete_permanently(torrent.get("hash")) # type: ignore
|
||||||
print(f"Removed {torrent.get('name')}") # type: ignore
|
print(f"Removed {torrent.get('name')}") # type: ignore
|
||||||
|
|
||||||
|
|
||||||
def add_almalinux(rel_ver: str):
|
def add_almalinux(rel_ver: str):
|
||||||
@ -177,9 +177,9 @@ def remove_fedora(rel_ver: str):
|
|||||||
"""
|
"""
|
||||||
torrents = qb.torrents()
|
torrents = qb.torrents()
|
||||||
for torrent in torrents:
|
for torrent in torrents:
|
||||||
if torrent.get("name").startswith("Fedora") and torrent.get("name").endswith(rel_ver): # type: ignore
|
if torrent.get("name").startswith("Fedora") and torrent.get("name").endswith(rel_ver): # type: ignore
|
||||||
qb.delete_permanently(torrent.get("hash")) # type: ignore
|
qb.delete_permanently(torrent.get("hash")) # type: ignore
|
||||||
print(f"Removed {torrent.get('name')}") # type: ignore
|
print(f"Removed {torrent.get('name')}") # type: ignore
|
||||||
|
|
||||||
|
|
||||||
def add_freebsd(rel_ver: str):
|
def add_freebsd(rel_ver: str):
|
||||||
@ -363,7 +363,7 @@ if __name__ == "__main__":
|
|||||||
"gum",
|
"gum",
|
||||||
"choose",
|
"choose",
|
||||||
"--limit=1",
|
"--limit=1",
|
||||||
"--header='Available torrents'",
|
"--header=Available torrents",
|
||||||
"--height=13",
|
"--height=13",
|
||||||
"AlmaLinux",
|
"AlmaLinux",
|
||||||
"Debian",
|
"Debian",
|
||||||
|
Loading…
Reference in New Issue
Block a user