From d714c691cf4696035659b3d9ff20d40868fa2a39 Mon Sep 17 00:00:00 2001 From: hhm Date: Wed, 1 Mar 2017 00:54:55 -0500 Subject: [PATCH] B"H use range requests when available (flask >= 0.12) --- supysonic/api/media.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supysonic/api/media.py b/supysonic/api/media.py index bc50ca9..d231ad6 100644 --- a/supysonic/api/media.py +++ b/supysonic/api/media.py @@ -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)) response = Response(transcode(), mimetype = dst_mimetype) 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.last_play = now() @@ -135,7 +135,7 @@ def download_media(): if not status: return res - return send_file(res.path) + return send_file(res.path, conditional=True) @app.route('/rest/getCoverArt.view', methods = [ 'GET', 'POST' ]) def cover_art():