From 7516090e14de3774170c005a65ca70236c2e4e69 Mon Sep 17 00:00:00 2001 From: simon Date: Sun, 5 Dec 2021 22:15:10 +0700 Subject: [PATCH] handle findPlaylists notification and fix spacing --- tubearchivist/home/tasks.py | 6 ++---- tubearchivist/static/css/style.css | 4 ++-- tubearchivist/static/script.js | 3 +++ 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tubearchivist/home/tasks.py b/tubearchivist/home/tasks.py index 651eb06..9c8a77c 100644 --- a/tubearchivist/home/tasks.py +++ b/tubearchivist/home/tasks.py @@ -277,14 +277,13 @@ def index_channel_playlists(channel_id): all_indexed = PendingList().get_all_indexed() all_youtube_ids = [i["youtube_id"] for i in all_indexed] - counter = 1 - for playlist_id, playlist_title in all_playlists: + for idx, (playlist_id, playlist_title) in enumerate(all_playlists): # notify mess_dict = { "status": "message:playlistscan", "level": "info", "title": "Scanning channel for playlists", - "message": f"Progress: {counter}/{len(all_playlists)}", + "message": f"Progress: {idx + 1}/{len(all_playlists)}", } RedisArchivist().set_message("message:playlistscan", mess_dict) print("add playlist: " + playlist_title) @@ -305,7 +304,6 @@ def index_channel_playlists(channel_id): continue playlist_handler.upload_to_es() playlist_handler.add_vids_to_playlist() - counter = counter + 1 if all_playlists: handler = ThumbManager() diff --git a/tubearchivist/static/css/style.css b/tubearchivist/static/css/style.css index 36c3254..be77369 100644 --- a/tubearchivist/static/css/style.css +++ b/tubearchivist/static/css/style.css @@ -808,7 +808,7 @@ button:hover { .dl-control-icons { display: flex; justify-content: center; - padding: 10px 0; + padding-bottom: 10px; } .dl-control-icons img { @@ -835,7 +835,7 @@ button:hover { background-color: var(--highlight-bg); text-align: center; padding: 30px 0 15px 0; - margin-bottom: 1rem; + margin: 1rem 0; } .notification.info { diff --git a/tubearchivist/static/script.js b/tubearchivist/static/script.js index 844ed4b..1282aed 100644 --- a/tubearchivist/static/script.js +++ b/tubearchivist/static/script.js @@ -225,6 +225,9 @@ function findPlaylists(button) { var message = document.createElement('p'); message.innerText = 'Scraping for playlists in progress'; document.getElementById("find-playlists-button").replaceWith(message); + setTimeout(function(){ + checkMessages(); + }, 500); } // delete from file system