You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
getDiscography/python/utils/process.py

24 lines
698 B

import requests
from utils.download import download_album
def process_artist_queue():
print('Running Artist Queue process..')
print('---')
requests.get('http://nginx/api/queue/artists/run')
return
def process_album_queue():
print('Running Album Queue Process..')
print('---')
response = requests.get('http://nginx/api/album/queue')
data = response.json()
artist = data.get('artist', False)
album = data.get('album', False)
queue = data.get('queue')
if not queue == False and artist and album:
result = download_album(album, artist)
requests.post('http://nginx/api/album/queue/update/%s' % queue.get('id'), json=result)
return