From 1e2a7b2569dd4390ef84b6fb88eb0ed76a7d2b8b Mon Sep 17 00:00:00 2001 From: Felix Stupp Date: Sat, 30 Oct 2021 12:06:57 +0200 Subject: [PATCH] app: Add endpoint for listing collections with unwatched episodes --- server/app.py | 4 ++++ server/templates/macros.htm | 1 + 2 files changed, 5 insertions(+) diff --git a/server/app.py b/server/app.py index ec09d1d..1255019 100644 --- a/server/app.py +++ b/server/app.py @@ -218,6 +218,10 @@ def list_collection(): def extract_collection(): return render_template("collection_extract.htm") +@flask_app.route("/collection/to_watch") +def list_collections_with_unwatched(): + return _list_collections(lambda collection: not collection.ignored and not collection.completed) + @flask_app.route("/collection/pinned") def list_pinned_collection(): collection_list: Iterable[MediaCollection] = orm.select(c for c in MediaCollection if c.pinned).order_by(orm.desc(MediaCollection.release_date), MediaCollection.title, MediaCollection.id) diff --git a/server/templates/macros.htm b/server/templates/macros.htm index dbb69ac..8b62622 100644 --- a/server/templates/macros.htm +++ b/server/templates/macros.htm @@ -67,6 +67,7 @@ "Latest Media": "/media", "All Collections": "/collection", "Pinned Collections": "/collection/pinned", + "Collections To Watch": "/collection/to_watch", "Show Old Variety": "/recommendations/simple/variety", "BINGE": "/recommendations/simple/binge", "Stats": "/stats",