aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app.cfg.example1
-rwxr-xr-xroka.py3
-rw-r--r--templates/index.html6
3 files changed, 9 insertions, 1 deletions
diff --git a/app.cfg.example b/app.cfg.example
index 94d2ef2..114de0b 100644
--- a/app.cfg.example
+++ b/app.cfg.example
@@ -1,3 +1,4 @@
ROOT_PATH = '/path/to/audiobooks'
USERNAME = 'username'
PASSWORD = 'password'
+SHOW_PATH = True
diff --git a/roka.py b/roka.py
index 4c4da57..ebfd9cb 100755
--- a/roka.py
+++ b/roka.py
@@ -49,7 +49,8 @@ def list_books():
form = {'WWW-Authenticate': 'Basic realm="o/"'}
return Response('unauthorized', 401, form)
- return render_template('index.html', books=books)
+ return render_template('index.html', books=books,
+ show_path=app.config.get('SHOW_PATH', True))
if __name__ == '__main__':
desc = 'roka: listen to audiobooks with podcast apps via RSS'
diff --git a/templates/index.html b/templates/index.html
index c05ff8e..a31b763 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -28,7 +28,10 @@
<table>
<tr>
<th>Title</th>
+ <th>Author</th>
+ {% if show_path %}
<th>Path</th>
+ {% endif %}
<th>Tracks</th>
<th>Duration</th>
<th>Size</th>
@@ -36,7 +39,10 @@
{% for b, v in books.items() %}
<tr>
<td><a href="?a={{ b }}">{{ v['title']|escape }}</a></td>
+ <td>{{ v['author'] }}</td>
+ {% if show_path %}
<td>{{ v['path']|escape }}</td>
+ {% endif %}
<td>{{ v['files']|length }}</td>
<td>{{ v['duration_str'] }}</td>
<td>{{ v['size_str'] }}</td>