[IMP] Minor improvements to logic

refactor_total
Brett Spaulding 2 years ago
parent be7bf92f5c
commit beadfb4159

6
.gitignore vendored

@ -2,3 +2,9 @@
navidrome/
music/
.idea/
utils/__pycache__/
*.pyc
geckodriver.log

Binary file not shown.

Binary file not shown.

@ -29,7 +29,7 @@ def process_downloads():
Album.purge()
cron = BackgroundScheduler({'apscheduler.job_defaults.max_instances': 3}, daemon=True)
cron = BackgroundScheduler({'apscheduler.job_defaults.max_instances': 2}, daemon=True)
cron.add_job(process_downloads, 'interval', minutes=1)
cron.start()

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 16 4 C 9.382813 4 4 9.382813 4 16 C 4 22.617188 9.382813 28 16 28 C 22.617188 28 28 22.617188 28 16 C 28 9.382813 22.617188 4 16 4 Z M 16 6 C 21.535156 6 26 10.464844 26 16 C 26 21.535156 21.535156 26 16 26 C 10.464844 26 6 21.535156 6 16 C 6 10.464844 10.464844 6 16 6 Z M 13.21875 8.5 C 11.042969 9.308594 9.308594 11.042969 8.5 13.21875 L 10.375 13.90625 C 10.980469 12.277344 12.277344 10.980469 13.90625 10.375 Z M 16 13 C 14.355469 13 13 14.355469 13 16 C 13 17.644531 14.355469 19 16 19 C 17.644531 19 19 17.644531 19 16 C 19 14.355469 17.644531 13 16 13 Z M 16 15 C 16.5625 15 17 15.4375 17 16 C 17 16.5625 16.5625 17 16 17 C 15.4375 17 15 16.5625 15 16 C 15 15.4375 15.4375 15 16 15 Z M 21.625 18.09375 C 21.019531 19.722656 19.722656 21.019531 18.09375 21.625 L 18.78125 23.5 C 20.957031 22.691406 22.691406 20.957031 23.5 18.78125 Z"/></svg>

After

Width:  |  Height:  |  Size: 923 B

@ -10,10 +10,10 @@
crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="/static/css/line-awesome.min.css"/>
<link rel="stylesheet" type="text/css" href="/static/css/style.css"/>
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="apple-touch-icon.png">
<link rel="icon" type="image/svg+xml" href="/static/favicon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon.svg">
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon.svg">
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/static/favicon.svg">
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg">
<meta name="theme-color" content="#1db8d7">
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
</head>

Binary file not shown.

@ -14,9 +14,6 @@ def download_album(album):
:param album: Dict of album data
:return:
"""
print('------')
print('Album Data')
print(album)
artist = album.get('artist')
artist_path = MEDIA_FOLDER + '/%s' % artist
if not os.path.exists(artist_path):
@ -55,8 +52,8 @@ def download_album(album):
except Exception as e:
print('!!!!!!!!!')
print(e)
Album.unlink(album['id'])
finally:
Album.unlink(album['id'])
def download_file(url, output):

Binary file not shown.

@ -48,7 +48,7 @@ def scrape(artist):
try:
# get the financial value when it's populated to the page
value_element = WebDriverWait(browser, 5).until(
value_element = WebDriverWait(browser, 10).until(
EC.presence_of_element_located(locator=(By.XPATH, '//div[@id="shelf-container"]'))
)
element = browser.find_element(By.XPATH, ALBUM_CONTAINER_ITEMS_XPATH)
@ -74,7 +74,7 @@ def scrape(artist):
time.sleep(1)
finally:
# after 5 seconds, give up
# after 10 seconds, give up
browser.quit()
return scrape_data

Loading…
Cancel
Save