Skip song from commandline.

This commit is contained in:
Jim Driessen
2017-02-09 11:26:41 +01:00
parent bceeb01f67
commit 4960d834fd

View File

@ -0,0 +1,16 @@
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()