Change player to OAuth protocol

This commit is contained in:
Lars van Rhijn
2023-11-12 09:33:19 +01:00
parent 66ac1076d3
commit d55ff6c8c6
16 changed files with 206 additions and 124 deletions

View File

@ -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()