fix: absolute config path not resolving

+ skip through empty directories in folder browser
+ handle timestamp table error in migration
This commit is contained in:
mungai-njoroge
2024-04-01 11:02:27 +03:00
parent 95a8e9b215
commit 2f6e705c75
9 changed files with 64 additions and 35 deletions
+1 -5
View File
@@ -1,12 +1,12 @@
"""
Requests related to artists
"""
import urllib.parse
import requests
from requests import ConnectionError, HTTPError, ReadTimeout
#from app import settings
from app.utils.hashing import create_hash
@@ -16,10 +16,6 @@ def fetch_similar_artists(name: str):
"""
url = f"https://kerve.last.fm/kerve/similarartists?artist={urllib.parse.quote_plus(name, safe='')}&autocorrect=1&tracks=1&image_size=large&limit=250&format=json"
# REVIEW This is the old way of doing it. The new way is to use the Kerve API.
#url = f"https://ws.audioscrobbler.com/2.0/?method=artist.getsimilar&artist={urllib.parse.quote_plus(name, safe='')}&api_key={settings.Keys.LASTFM_API_KEY}&format=json&limit=250"
# TODO Cannot be tested due to PR message
url = f"https://kerve.last.fm/kerve/similarartists?artist={urllib.parse.quote_plus(name, safe='')}&autocorrect=1&tracks=1&image_size=large&limit=250&format=json"
try:
response = requests.get(url, timeout=10)
response.raise_for_status()