diff options
-rw-r--r-- | app.cfg.example | 1 | ||||
-rwxr-xr-x | roka.py | 3 | ||||
-rw-r--r-- | templates/index.html | 6 |
3 files changed, 9 insertions, 1 deletions
diff --git a/app.cfg.example b/app.cfg.example index 1fe4968..05a9144 100644 --- a/app.cfg.example +++ b/app.cfg.example @@ -3,3 +3,4 @@ ROOT_PATH = '/path/to/audiobooks' BASE_URL = 'https://example.com/' USERNAME = 'username' PASSWORD = 'password' +SHOW_PATH = True @@ -51,7 +51,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)) def generate(static_path, base_url, audiobook_dirs): static_index_path = os.path.join(static_path, 'index.html') diff --git a/templates/index.html b/templates/index.html index 4e6998d..bac87d2 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=' if not static else '/'}}{{ b }}{{'.xml' if static}}">{{ 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> |