1
0
mirror of https://github.com/spl0k/supysonic.git synced 2024-11-10 04:02:17 +00:00

B"H use range requests when available (flask >= 0.12)

This commit is contained in:
hhm 2017-03-01 00:54:55 -05:00
parent c334a14d69
commit d714c691cf

View File

@ -119,7 +119,7 @@ def stream_media():
app.logger.info('Transcoding track {0.id} for user {1.id}. Source: {2} at {0.bitrate}kbps. Dest: {3} at {4}kbps'.format(res, request.user, src_suffix, dst_suffix, dst_bitrate)) app.logger.info('Transcoding track {0.id} for user {1.id}. Source: {2} at {0.bitrate}kbps. Dest: {3} at {4}kbps'.format(res, request.user, src_suffix, dst_suffix, dst_bitrate))
response = Response(transcode(), mimetype = dst_mimetype) response = Response(transcode(), mimetype = dst_mimetype)
else: else:
response = send_file(res.path, mimetype = dst_mimetype) response = send_file(res.path, mimetype = dst_mimetype, conditional=True)
res.play_count = res.play_count + 1 res.play_count = res.play_count + 1
res.last_play = now() res.last_play = now()
@ -135,7 +135,7 @@ def download_media():
if not status: if not status:
return res return res
return send_file(res.path) return send_file(res.path, conditional=True)
@app.route('/rest/getCoverArt.view', methods = [ 'GET', 'POST' ]) @app.route('/rest/getCoverArt.view', methods = [ 'GET', 'POST' ])
def cover_art(): def cover_art():