dithered images

still needs to be integrated with celery, but works for now
This commit is contained in:
2024-02-21 17:46:31 +01:00
parent 81a60804b1
commit 10703beaca
5 changed files with 27 additions and 4 deletions
+3 -1
View File
@@ -7,7 +7,7 @@ import re
from .models import Track, Artist, Album, Vote, Background, Profile
from .utils import from_json, get_unvoted
from . import spotify
from .tasks import get_banter
from .tasks import get_banter, get_and_dither_image
spt = spotify.Spotify()
@@ -22,6 +22,8 @@ class AuthView(View):
class VoteView(LoginRequiredMixin, View):
def get(self, request, error=None):
track = get_unvoted(request.user)
if not track.album.image:
get_and_dither_image(track.album.image_url, track.album, "image")
return TemplateResponse(request, "Vote.html", {"track": track, "error": error})
def post(self, request):
try: