dithered images
still needs to be integrated with celery, but works for now
This commit is contained in:
+3
-1
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user