mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-10 08:02:26 +01:00
fix all pylint complaints
This commit is contained in:
@ -1,3 +0,0 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
@ -1,3 +0,0 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
@ -1,3 +0,0 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
@ -14,16 +14,16 @@ from .decorators import token_required
|
||||
@csrf_exempt
|
||||
@token_required
|
||||
def queue(request):
|
||||
queue = get_object_or_404(Queue, id=request.POST.get('queue'))
|
||||
current_queue = get_object_or_404(Queue, id=request.POST.get('queue'))
|
||||
|
||||
commands = queue.queuecommand_set.filter(executed=False)
|
||||
commands = current_queue.queuecommand_set.filter(executed=False)
|
||||
for command in commands:
|
||||
command.executed = True
|
||||
command.save()
|
||||
|
||||
return JsonResponse({
|
||||
'current_song': playlist_song_to_dict(queue.current_song(), hash=True, replaygain=True),
|
||||
'queue': [playlist_song_to_dict(playlist_song, hash=True, replaygain=True) for playlist_song in queue.queue()[:1]],
|
||||
'current_song': playlist_song_to_dict(current_queue.current_song(), include_hash=True, include_replaygain=True),
|
||||
'queue': [playlist_song_to_dict(playlist_song, include_hash=True, include_replaygain=True) for playlist_song in current_queue.queue()[:1]],
|
||||
'commands': [command.command for command in commands]
|
||||
})
|
||||
|
||||
@ -31,9 +31,9 @@ def queue(request):
|
||||
@csrf_exempt
|
||||
@token_required
|
||||
def play(request):
|
||||
queue = get_object_or_404(Queue, id=request.POST.get('queue'))
|
||||
queue.started_at = timezone.now()
|
||||
queue.save()
|
||||
current_queue = get_object_or_404(Queue, id=request.POST.get('queue'))
|
||||
current_queue.started_at = timezone.now()
|
||||
current_queue.save()
|
||||
current_song = queue.current_song()
|
||||
current_song.played_at = queue.started_at
|
||||
current_song.save()
|
||||
@ -41,11 +41,12 @@ def play(request):
|
||||
return JsonResponse({})
|
||||
|
||||
|
||||
# pylint: disable=redefined-builtin
|
||||
@csrf_exempt
|
||||
@token_required
|
||||
def next(request):
|
||||
queue = get_object_or_404(Queue, id=request.POST.get('queue'))
|
||||
player_song = queue.current_song()
|
||||
current_queue = get_object_or_404(Queue, id=request.POST.get('queue'))
|
||||
player_song = current_queue.current_song()
|
||||
player_song.state = 2
|
||||
player_song.save()
|
||||
return JsonResponse({})
|
||||
|
||||
Reference in New Issue
Block a user