mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-09 19:52:20 +01:00
17 lines
485 B
Python
17 lines
485 B
Python
from django.core.management.base import BaseCommand
|
|
from django.shortcuts import get_object_or_404
|
|
from queues.models import Queue
|
|
|
|
|
|
class Command(BaseCommand):
|
|
help = 'Skip a song of a playlist.'
|
|
|
|
def add_arguments(self, parser):
|
|
parser.add_argument('queue_id')
|
|
|
|
def handle(self, *args, **options):
|
|
queue = get_object_or_404(Queue, id=options['queue_id'])
|
|
player_song = queue.current_song()
|
|
player_song.state = 2
|
|
player_song.save()
|