Skip to content

Commit

Permalink
Add donation link to playlist descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
jdemaeyer committed Jun 13, 2023
1 parent 8d44358 commit 2911ac6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions spoqify/anonymization.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,9 @@ async def anonymize_playlist(playlist_id, station=False):
min(5, len(data['tracks'])))
data['tracks'] = await load_recommendations(tracks=sample_tracks)
date_str = datetime.date.today().strftime('%d %B %Y').lstrip('0')
reanon_url = data['url'].replace('spotify.com', 'spoqify.com')
description = (
f"Anonymized on {date_str} via spoqify.com · Original playlist: "
f"{data['url']} · Freshly anonymized playlist: {reanon_url}")
f"{data['url']} · Buy me a Coffee: https://donate.spoqify.com")
url = await create_playlist(data['title'], description, data['tracks'])
return url

Expand Down Expand Up @@ -218,6 +217,8 @@ async def make_recommendations_playlist(
f"'{data['name']}'. This can sometimes happen for little-known "
"songs or artists. Please try again with a song radio URL.")
date_str = datetime.date.today().strftime('%d %B %Y').lstrip('0')
description = f"Anonymized on {date_str} via spoqify.com."
description = (
f"Anonymized on {date_str} via spoqify.com · Buy me a Coffee: "
f"https://donate.spoqify.com/")
url = await create_playlist(title, description, tracks)
return url

0 comments on commit 2911ac6

Please sign in to comment.