06-sep: [menu] Bajar solo si hay torrents; volver limpia bajar

This commit is contained in:
juanjo
2026-09-06 18:01:59 +02:00
parent b982e69175
commit 3193c30340

View File

@@ -94,6 +94,10 @@ def teclado_videoclub(chat_id):
if titulos:
filas.append([
_btn("🧲 Torrents…", PREFIJO + "sub:torrents"),
])
torrents = _txt("ultimos_torrents", chat_id)
if torrents and torrents.get("torrents"):
filas.append([
_btn("⬇️ Bajar…", PREFIJO + "sub:bajar"),
])
filas.append(FILA_VOLVER)
@@ -519,6 +523,13 @@ def _teclado_categoria(chat_id, categoria):
def _abrir_categoria(chat_id, message_id, categoria):
if categoria == "videoclub":
# Al volver atras se olvida la eleccion de torrents (se queda Torrents).
try:
import pi_bot
pi_bot.ultimos_torrents.pop(chat_id, None)
except Exception:
pass
_record_cat(chat_id, categoria)
teclado = _teclado_categoria(chat_id, categoria)
if teclado is None: