06-sep: [menu] Bajar solo si hay torrents; volver limpia bajar
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user