From 88f28a7d1e01680ec0b04fe94e5b688893140bb6 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 29 Oct 2021 12:23:33 +0700 Subject: [PATCH] userspace show_ignored_only on downloads view --- tubearchivist/home/views.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tubearchivist/home/views.py b/tubearchivist/home/views.py index b18341c..f855275 100644 --- a/tubearchivist/home/views.py +++ b/tubearchivist/home/views.py @@ -263,7 +263,7 @@ class DownloadView(View): if not view_style: view_style = config["default_view"]["downloads"] - ignored = RedisArchivist().get_message("show_ignored_only") + ignored = RedisArchivist().get_message(f"{user_id}:show_ignored_only") show_ignored_only = ignored["status"] es_url = config["application"]["es_url"] @@ -272,7 +272,7 @@ class DownloadView(View): "es_url": es_url, "colors": colors, "view_style": view_style, - "show_ignored_only": show_ignored_only + "show_ignored_only": show_ignored_only, } return view_config @@ -790,10 +790,10 @@ class PostData: def show_ignored_only(self): """switch view on /downloads/ to show ignored only""" show_value = self.exec_val + key = f"{self.current_user}:show_ignored_only" + value = {"status": show_value} print(f"Filter download view ignored only: {show_value}") - RedisArchivist().set_message( - "show_ignored_only", {"status": show_value}, expire=False - ) + RedisArchivist().set_message(key, value, expire=False) return {"success": True} def forget_ignore(self):