Skip to content

Commit 3819729

Browse files
authored
Merge pull request #8628 from pc-beast/loop-autoplay
feat: allow loop and autoplay to public streams
2 parents ae57152 + e9c6e5d commit 3819729

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

app/api/schema/events.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from email.policy import default
12
import pytz
23
from flask_rest_jsonapi.exceptions import ObjectNotFound
34
from marshmallow import validate, validates_schema
@@ -58,6 +59,8 @@ def validate_timezone(self, data, original_data):
5859
location_name = fields.Str(allow_none=True)
5960
searchable_location_name = fields.Str(allow_none=True)
6061
public_stream_link = fields.Str(allow_none=True)
62+
stream_loop = fields.Boolean(default=False)
63+
stream_autoplay = fields.Boolean(default=False)
6164
description = fields.Str(allow_none=True)
6265
after_order_message = fields.Str(allow_none=True)
6366
original_image_url = fields.Url(allow_none=True)

app/models/event.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from email.policy import default
12
import re
23
from argparse import Namespace
34
from datetime import datetime
@@ -63,6 +64,8 @@ class Privacy:
6364
location_name = db.Column(db.String)
6465
searchable_location_name = db.Column(db.String)
6566
public_stream_link = db.Column(db.String)
67+
stream_loop = db.Column(db.Boolean, default = False)
68+
stream_autoplay = db.Column(db.Boolean, default=False)
6669
is_featured = db.Column(db.Boolean, default=False, nullable=False)
6770
is_promoted = db.Column(db.Boolean, default=False, nullable=False)
6871
is_demoted = db.Column(db.Boolean, default=False, nullable=False)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
"""empty message
2+
3+
Revision ID: a45167cdc102
4+
Revises: 0dba0c2e0ba0
5+
Create Date: 2022-04-04 17:35:59.622520
6+
7+
"""
8+
9+
from alembic import op
10+
import sqlalchemy as sa
11+
import sqlalchemy_utils
12+
13+
14+
# revision identifiers, used by Alembic.
15+
revision = 'a45167cdc102'
16+
down_revision = '0dba0c2e0ba0'
17+
18+
19+
def upgrade():
20+
# ### commands auto generated by Alembic - please adjust! ###
21+
op.add_column('events', sa.Column('stream_loop', sa.Boolean(), nullable=True))
22+
op.add_column('events', sa.Column('stream_autoplay', sa.Boolean(), nullable=True))
23+
op.add_column('events_version', sa.Column('stream_loop', sa.Boolean(), autoincrement=False, nullable=True))
24+
op.add_column('events_version', sa.Column('stream_autoplay', sa.Boolean(), autoincrement=False, nullable=True))
25+
# ### end Alembic commands ###
26+
27+
28+
def downgrade():
29+
# ### commands auto generated by Alembic - please adjust! ###
30+
op.drop_column('events_version', 'stream_autoplay')
31+
op.drop_column('events_version', 'stream_loop')
32+
op.drop_column('events', 'stream_autoplay')
33+
op.drop_column('events', 'stream_loop')
34+
# ### end Alembic commands ###

0 commit comments

Comments
 (0)