updated solution

This commit is contained in:
2025-07-31 16:37:54 +03:00
parent 756f9052b5
commit c8bbbebb48
31 changed files with 199 additions and 190 deletions

18
models/player.py Normal file
View File

@@ -0,0 +1,18 @@
from extensions import db
from flask_bcrypt import Bcrypt
bcrypt = Bcrypt()
class Player(db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(255), nullable=False)
hostname = db.Column(db.String(255), nullable=False)
password = db.Column(db.String(255), nullable=False)
quickconnect_password = db.Column(db.String(255), nullable=True)
playlist_version = db.Column(db.Integer, default=1)
locked_to_group_id = db.Column(db.Integer, db.ForeignKey('group.id'), nullable=True)
locked_to_group = db.relationship('Group', foreign_keys=[locked_to_group_id], backref='locked_players')
orientation = db.Column(db.String(16), nullable=False, default='Landscape') # <-- Add this line
def verify_quickconnect_code(self, code):
return bcrypt.check_password_hash(self.quickconnect_password, code)