From f33ee09ceff303cf26ca22f24f837f00d4963b76 Mon Sep 17 00:00:00 2001 From: Dylan Garrett Date: Mon, 7 Jun 2021 23:05:59 -0700 Subject: Put the Author instead of the filename in the index --- templates/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/index.html b/templates/index.html index c05ff8e..dc0eddd 100644 --- a/templates/index.html +++ b/templates/index.html @@ -28,7 +28,7 @@ - + @@ -36,7 +36,7 @@ {% for b, v in books.items() %} - + -- cgit v1.2.3-54-g00ecf From 3df6eace945cc07bc02cdeff3dbad5552954d279 Mon Sep 17 00:00:00 2001 From: Dylan Garrett Date: Wed, 9 Jun 2021 20:40:53 -0700 Subject: Don't need to escape author --- templates/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/index.html b/templates/index.html index dc0eddd..a30577e 100644 --- a/templates/index.html +++ b/templates/index.html @@ -36,7 +36,7 @@ {% for b, v in books.items() %} - + -- cgit v1.2.3-54-g00ecf From 9f02e8aed1b59d209c66ca29ba1df843ea9be79e Mon Sep 17 00:00:00 2001 From: Dylan Garrett Date: Wed, 9 Jun 2021 20:48:24 -0700 Subject: Make showing path optional --- roka.py | 3 ++- templates/index.html | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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 a30577e..a31b763 100644 --- a/templates/index.html +++ b/templates/index.html @@ -29,6 +29,9 @@ + {% if show_path %} + + {% endif %} @@ -37,6 +40,9 @@ + {% if show_path %} + + {% endif %} -- cgit v1.2.3-54-g00ecf From 3cc49916660f71e0498fa8c9e2c13df1fe138a56 Mon Sep 17 00:00:00 2001 From: Dylan Garrett Date: Wed, 9 Jun 2021 20:51:25 -0700 Subject: Demonstrate SHOW_PATH in app.cfg.example --- app.cfg.example | 1 + 1 file changed, 1 insertion(+) 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 -- cgit v1.2.3-54-g00ecf
TitlePathAuthor Tracks Duration Size
{{ v['title']|escape }}{{ v['path']|escape }}{{ v['author']|escape }} {{ v['files']|length }} {{ v['duration_str'] }} {{ v['size_str'] }}
{{ v['title']|escape }}{{ v['author']|escape }}{{ v['author'] }} {{ v['files']|length }} {{ v['duration_str'] }} {{ v['size_str'] }}
Title AuthorPathTracks Duration Size
{{ v['title']|escape }} {{ v['author'] }}{{ v['path']|escape }}{{ v['files']|length }} {{ v['duration_str'] }} {{ v['size_str'] }}