diff options
author | Jordan <me@jordan.im> | 2021-06-09 22:51:23 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-09 22:51:23 -0700 |
commit | 4cd0884b307e28bd9f2e531c41fb7b41600b02a4 (patch) | |
tree | 6dbc8d1aed8fb78c0237c2df229f2533fb92c8d9 | |
parent | 1035ea7c0f97d68c35a2621da410b600bc464fbe (diff) | |
parent | 3cc49916660f71e0498fa8c9e2c13df1fe138a56 (diff) | |
download | roka-4cd0884b307e28bd9f2e531c41fb7b41600b02a4.tar.gz roka-4cd0884b307e28bd9f2e531c41fb7b41600b02a4.zip |
Merge pull request #2 from dgarrett/show-author-optional-filename
Include Author on index page, and make file path optional
-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 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 @@ -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> |