aboutsummaryrefslogtreecommitdiff
path: root/run.py
diff options
context:
space:
mode:
Diffstat (limited to 'run.py')
-rwxr-xr-xrun.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/run.py b/run.py
index 90e61c0..71753eb 100755
--- a/run.py
+++ b/run.py
@@ -10,6 +10,7 @@ from collections import OrderedDict
from operator import getitem
from datetime import date, timedelta
from flask import Flask, request, Response, render_template, send_file
+from flask import send_from_directory
from xml.dom import minidom
abs_path = os.path.dirname(os.path.abspath(__file__))
@@ -198,7 +199,7 @@ def list_books():
pub_date = ET.SubElement(item, 'pubDate')
pub_date.text = (date(2000, 12, 31) - timedelta(days=idx)).ctime()
enc_attr = {
- 'url': '{}?a={}&f={}'.format( request.base_url, a, f),
+ 'url': '{}?a={}&f={}'.format(request.base_url, a, f),
'length': str(books[a]['files'][f]['size_bytes']),
'type': 'audio/mpeg'
}
@@ -212,5 +213,12 @@ def list_books():
return Response('unauthorized', 401, form)
return render_template('index.html', books=books)
+@app.route('/static/<path:path>')
+def send_static(path):
+ '''
+ Serve static files from the static directory
+ '''
+ return send_from_directory('static', path)
+
if __name__ == '__main__':
app.run(host='127.0.0.1', port='8085', threaded=True)