diff options
author | Dylan Garrett <dylan.garrett@gmail.com> | 2021-06-13 14:21:07 -0700 |
---|---|---|
committer | Dylan Garrett <dylan.garrett@gmail.com> | 2021-06-13 14:21:07 -0700 |
commit | d6ca0e96012f93a14428cdbe43408110639e4ef7 (patch) | |
tree | 717888ba7dd2ebc1e8642ba76a2a235abfda5154 | |
parent | 9ee86c545e14ade1fd14b7068bdda6cf5a7c47a9 (diff) | |
parent | 4cd0884b307e28bd9f2e531c41fb7b41600b02a4 (diff) | |
download | roka-d6ca0e96012f93a14428cdbe43408110639e4ef7.tar.gz roka-d6ca0e96012f93a14428cdbe43408110639e4ef7.zip |
Merge remote-tracking branch 'origin/master' into static-generation
-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> |