feat: consistent caching for bandcamp
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Hazel 2024-04-26 21:31:31 +02:00
parent 2bf362c696
commit 9a718af1c9

View File

@ -136,7 +136,7 @@ class Bandcamp(Page):
"full_page": True,
"search_filter": filter_string,
"search_text": search_query,
})
}, name=f"search_{filter_string}_{search_query}")
if r is None:
return results
@ -224,7 +224,7 @@ class Bandcamp(Page):
def fetch_artist(self, source: Source, stop_at_level: int = 1) -> Artist:
artist = Artist()
r = self.connection.get(_parse_artist_url(source.url))
r = self.connection.get(_parse_artist_url(source.url), name=f"artist_{urlparse(source.url).scheme}_{urlparse(source.url).netloc}")
if r is None:
return artist
@ -271,7 +271,7 @@ class Bandcamp(Page):
def fetch_album(self, source: Source, stop_at_level: int = 1) -> Album:
album = Album()
r = self.connection.get(source.url)
r = self.connection.get(source.url, name=f"album_{urlparse(source.url).netloc.split('.')[0]}_{urlparse(source.url).path.replace('/', '').replace('album', '')}")
if r is None:
return album
@ -338,7 +338,7 @@ class Bandcamp(Page):
return []
def fetch_song(self, source: Source, stop_at_level: int = 1) -> Song:
r = self.connection.get(source.url)
r = self.connection.get(source.url, name=f"song_{urlparse(source.url).netloc.split('.')[0]}_{urlparse(source.url).path.replace('/', '').replace('track', '')}")
if r is None:
return Song()