major refactors

- remove jpgs
- add new album header
- remove duplicate components
- display album bio on client
- add a route loader module
- change color scheme
- other minor changes
This commit is contained in:
geoffrey45
2022-01-18 20:51:22 +03:00
parent 2ee8d27bf0
commit 1d1e697fd2
38 changed files with 327 additions and 465 deletions
+10 -7
View File
@@ -60,7 +60,7 @@ def populate_images():
try:
response = requests.get(url)
except:
except requests.ConnectionError:
print('\n sleeping for 5 seconds')
time.sleep(5)
response = requests.get(url)
@@ -225,16 +225,19 @@ def getTags(full_path: str) -> dict:
def getAlbumBio(title: str, album_artist: str) -> dict:
last_fm_url = 'http://ws.audioscrobbler.com/2.0/?method=album.getinfo&api_key={}&artist={}&album={}&format=json'.format(
helpers.last_fm_api_key, album_artist, title)
response = requests.get(last_fm_url)
data = response.json()
try:
bio = data['album']['wiki']['content']
response = requests.get(last_fm_url)
data = response.json()
except requests.ConnectionError:
return "None"
try:
bio = data['album']['wiki']['summary'].split('<a href="https://www.last.fm/')[0]
except KeyError:
bio = None
if bio is None:
return "None"
return {'data': data}
return bio