thrimshim: Return list of available transitions

For use in thrimbletrimmer for a drop-down.
pull/401/head
Mike Lang 3 months ago
parent d4de1f94be
commit 12150a4005

@ -12,12 +12,12 @@ import gevent
import gevent.backdoor
from gevent.pywsgi import WSGIServer
import prometheus_client
import psycopg2
from psycopg2 import sql
import common
from common import database, dateutil
from common.flask_stats import request_stats, after_request
from common.segments import KNOWN_XFADE_TRANSITIONS, CUSTOM_XFADE_TRANSITIONS
import google.oauth2.id_token
import google.auth.transport.requests
@ -144,6 +144,21 @@ def get_defaults():
})
@app.route('/thrimshim/transitions')
@request_stats
def get_transitions():
"""Get info on available transitions. Returns a list of {name, description}."""
items = [
(name, description) for name, description in KNOWN_XFADE_TRANSITIONS.items()
] + [
(name, description) for name, (description, expr) in CUSTOM_XFADE_TRANSITIONS.items()
]
return [
{"name": name, "description": description}
for name, description in items
]
@app.route('/thrimshim/<ident>', methods=['GET'])
@request_stats
def get_row(ident):

Loading…
Cancel
Save