Mixonomer/main.run_playlist.py

16 lines
561 B
Python

def run_user_playlist(event, context):
import logging
logger = logging.getLogger('music')
if event.get('attributes'):
if 'username' in event['attributes'] and 'name' in event['attributes']:
from music.tasks.run_user_playlist import run_user_playlist as do_run_user_playlist
do_run_user_playlist(username=event['attributes']['username'], playlist_name=event['attributes']["name"])
else:
logger.error('no parameters in event attributes')
else:
logger.error('no attributes in event')