mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-10 10:22:20 +01:00
Change player to OAuth protocol
This commit is contained in:
@ -2,6 +2,7 @@ from django.db import models
|
||||
from django.db.models import Q
|
||||
from django.conf import settings
|
||||
from django.utils import timezone
|
||||
from oauth2_provider.models import Application
|
||||
|
||||
from queues.exceptions import RequestException
|
||||
from songs.models import Song
|
||||
@ -81,6 +82,14 @@ class Queue(models.Model):
|
||||
)
|
||||
started_at = models.DateTimeField(blank=True, null=True)
|
||||
player_token = models.TextField(blank=True, null=True)
|
||||
oauth_client = models.ForeignKey(
|
||||
Application,
|
||||
on_delete=models.SET_NULL,
|
||||
help_text="The OAuth2 client that may read and write commands for this Queue.",
|
||||
related_name="queues",
|
||||
null=True,
|
||||
blank=True,
|
||||
)
|
||||
|
||||
def get_songs(self):
|
||||
self.fill_random_queue()
|
||||
|
||||
Reference in New Issue
Block a user