2020-06-30 16:38:06 +01:00
|
|
|
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
|
2021-02-08 16:18:16 +00:00
|
|
|
do_run_user_playlist(user=event['attributes']['username'], playlist=event['attributes']["name"])
|
2020-06-30 16:38:06 +01:00
|
|
|
|
|
|
|
else:
|
|
|
|
logger.error('no parameters in event attributes')
|
|
|
|
else:
|
|
|
|
logger.error('no attributes in event')
|