From 7df4233224a73a56b527a7400d072322478d10c0 Mon Sep 17 00:00:00 2001 From: simon Date: Sun, 3 Oct 2021 19:33:58 +0700 Subject: [PATCH] cleaning up leftover code from old vesions --- tubearchivist/home/apps.py | 20 -------------- tubearchivist/home/config.json | 3 --- .../home/templates/home/channel_id.html | 2 +- .../home/templates/home/settings.html | 27 ------------------- tubearchivist/home/views.py | 2 ++ tubearchivist/static/css/style.css | 1 + tubearchivist/static/script.js | 3 --- 7 files changed, 4 insertions(+), 54 deletions(-) diff --git a/tubearchivist/home/apps.py b/tubearchivist/home/apps.py index 105d1a9..f421e2f 100644 --- a/tubearchivist/home/apps.py +++ b/tubearchivist/home/apps.py @@ -8,25 +8,6 @@ from home.src.helper import RedisArchivist from home.src.index_management import index_check -def sync_redis_state(): - """make sure redis gets the config.json values""" - print("sync redis") - config_handler = ArchivistConfig() - config_handler.load_new_defaults() - config = config_handler.config - sort_order = config["archive"]["sort"] - redis_archivist = RedisArchivist() - redis_archivist.set_message("sort_order", sort_order, expire=False) - hide_watched = bool(int(config["archive"]["hide_watched"])) - redis_archivist.set_message("hide_watched", hide_watched, expire=False) - show_subed_only = bool(int(config["archive"]["show_subed_only"])) - redis_archivist.set_message( - "show_subed_only", show_subed_only, expire=False - ) - filter_view = config["archive"]["filter_view"] - redis_archivist.set_message("filter_view", filter_view, expire=False) - - def make_folders(): """make needed cache folders here so docker doesn't mess it up""" folders = ["download", "channels", "videos", "import", "backup"] @@ -58,5 +39,4 @@ class HomeConfig(AppConfig): def ready(self): release_lock() index_check() - sync_redis_state() make_folders() diff --git a/tubearchivist/home/config.json b/tubearchivist/home/config.json index 6585c20..3d3c50b 100644 --- a/tubearchivist/home/config.json +++ b/tubearchivist/home/config.json @@ -1,9 +1,6 @@ { "archive": { "sort": "published", - "filter_view": "pending", - "hide_watched": false, - "show_subed_only": false, "page_size": 12 }, "default_view": { diff --git a/tubearchivist/home/templates/home/channel_id.html b/tubearchivist/home/templates/home/channel_id.html index 8f00004..4255007 100644 --- a/tubearchivist/home/templates/home/channel_id.html +++ b/tubearchivist/home/templates/home/channel_id.html @@ -10,7 +10,7 @@ channel_banner {% endif %} -
+

Archive View

-
-

Current default Sort: {{ config.archive.sort }}

- Change how the home view and channels view sorts by defaults.
- -
-
-

Current default hide watched: {{ config.archive.hide_watched }}

- Show or hide watched videos by default.
- -
-
-

Current default show subscribed channels only: {{ config.archive.show_subed_only }}

- Show subscribed channels only by default.
- -

Current page size: {{ config.archive.page_size }}

Result of videos showing in archive page
diff --git a/tubearchivist/home/views.py b/tubearchivist/home/views.py index 6c8abee..9e20a45 100644 --- a/tubearchivist/home/views.py +++ b/tubearchivist/home/views.py @@ -111,6 +111,8 @@ class HomeView(View): colors = config_handler["application"]["colors"] view_style = config_handler["default_view"]["home"] sort_order = RedisArchivist().get_message("sort_order") + if not sort_order: + sort_order = "published" hide_watched = RedisArchivist().get_message("hide_watched") return colors, view_style, sort_order, hide_watched diff --git a/tubearchivist/static/css/style.css b/tubearchivist/static/css/style.css index 6e3a0b1..ddf749c 100644 --- a/tubearchivist/static/css/style.css +++ b/tubearchivist/static/css/style.css @@ -473,6 +473,7 @@ button:hover { .info-box { display: grid; grid-gap: 1rem; + margin: 1rem 0; } .info-box-3 { diff --git a/tubearchivist/static/script.js b/tubearchivist/static/script.js index 6007b62..550e11f 100644 --- a/tubearchivist/static/script.js +++ b/tubearchivist/static/script.js @@ -43,7 +43,6 @@ function toggleCheckbox(checkbox) { var payloadDict = {}; payloadDict[toggleId] = toggleVal; var payload = JSON.stringify(payloadDict); - console.log(payload); sendPost(payload); setTimeout(function(){ var currPage = window.location.pathname; @@ -91,7 +90,6 @@ function downloadNow(button) { function forgetIgnore(button) { var youtube_id = button.getAttribute('data-id'); var payload = JSON.stringify({'forgetIgnore': youtube_id}); - console.log(payload); sendPost(payload); document.getElementById("dl-" + youtube_id).remove(); } @@ -99,7 +97,6 @@ function forgetIgnore(button) { function addSingle(button) { var youtube_id = button.getAttribute('data-id'); var payload = JSON.stringify({'addSingle': youtube_id}); - console.log(payload); sendPost(payload); document.getElementById("dl-" + youtube_id).remove(); setTimeout(function(){