From b72d2f88e7f4ad32cba40e0dc72407ab6652500a Mon Sep 17 00:00:00 2001 From: Brett Spaulding Date: Tue, 13 Jun 2023 02:47:45 -0500 Subject: [PATCH] [FIX] stripe / from title as to not violate folder naming conventions --- requirements.txt | 1 + static/css/style.css | 2 +- static/js/app.js | 9 +++++---- templates/base.html | 4 ++-- utils/processor.py | 4 ++-- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/requirements.txt b/requirements.txt index ac2d3c0..a88add2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,7 @@ bs4 flask redis requests +rq selenium==3.14.1 selenium-requests urllib3==1.26.2 diff --git a/static/css/style.css b/static/css/style.css index baa07a4..666bec9 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -15,7 +15,7 @@ body { text-align: center; top: 50%; left: 50%; - transform: translate(-50%, -50%); + transform: translate(-50%, -50%) !important; } .card { diff --git a/static/js/app.js b/static/js/app.js index 12df0be..fad9647 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -1,15 +1,16 @@ $('#download_btn').on('click', () => { - console.log('Clicked Download!'); let artist = $('#search_bar').val(); // Prevent $('#search_bar').val(''); - console.log(artist); + if (artist) { $("#loader-wrapper").fadeIn(300); $.ajax({ url: `/api/v1/get/${artist}`, - }).done(function () { - $('#search_bar').val(''); + }).done(function (res) { + console.log('---'); + console.log(res); + console.log('---'); $("#loader-wrapper").fadeOut(700); }); } else { diff --git a/templates/base.html b/templates/base.html index d7863c6..0f3de46 100644 --- a/templates/base.html +++ b/templates/base.html @@ -18,8 +18,8 @@
-
- +
+
diff --git a/utils/processor.py b/utils/processor.py index 1569886..19b86bd 100644 --- a/utils/processor.py +++ b/utils/processor.py @@ -21,7 +21,7 @@ def download_file(url, output): def process_download(artist): artist = artist.title() # Initialize a new browser object to go collect the data we need - browser = new_browser(headless=False) + browser = new_browser(headless=True) url = QUERY_URL + artist browser.maximize_window() browser.implicitly_wait(1) @@ -77,7 +77,7 @@ def process_download(artist): album_title = album.find('div', {'id': 'card-title'}) if album_title and hasattr(album_title, 'text'): - album_data.update({'album': album_title.text.replace('\n', '')}) + album_data.update({'album': album_title.text.replace('\n', '').replace('/', '-')}) albums_data_list.append(album_data)