From ed5a910d5246922fd65e22c7b5b92681f554e4e7 Mon Sep 17 00:00:00 2001 From: Collin Heist Date: Tue, 3 Dec 2024 19:09:00 -0700 Subject: [PATCH] [146] Add template filter argument for current time --- app/models/template.py | 20 ++++++++++++--- app/templates/cardTemplates.html | 44 ++++++++++++++++++++++++++++++-- docs/user_guide/templates.md | 14 ++++++++-- modules/ref/version_webui | 2 +- 4 files changed, 71 insertions(+), 9 deletions(-) diff --git a/app/models/template.py b/app/models/template.py index c7877aa78..fa6965231 100755 --- a/app/models/template.py +++ b/app/models/template.py @@ -57,11 +57,22 @@ """Supported Argument keywords.""" ARGUMENT_KEYS = ( - 'Series Name', 'Series Year', 'Number of Seasons', 'Series Library Names', - 'Series Logo', 'Episode Watched Status', 'Season Number', 'Episode Number', - 'Absolute Number', 'Episode Identifier', 'Episode Title', - 'Episode Title Length', 'Episode Airdate', 'Episode Extras', + 'Absolute Number', + 'Current Time', + 'Episode Airdate', + 'Episode Extras', + 'Episode Identifier', + 'Episode Number', + 'Episode Title', + 'Episode Title Length', + 'Episode Watched Status', + 'Number of Seasons', 'Reference File', + 'Series Library Names', + 'Series Logo', + 'Series Name', + 'Season Number', + 'Series Year', ) """ @@ -302,6 +313,7 @@ def meets_filter_criteria(self, # Arguments for this Series and Episode library_names = [library['name'] for library in series.libraries] SERIES_ARGUMENTS = { + 'Current Time': datetime.now(), 'Series Name': series.name, 'Series Year': series.year, 'Series Library Names': library_names, diff --git a/app/templates/cardTemplates.html b/app/templates/cardTemplates.html index 807769a8c..bb0d83d3d 100755 --- a/app/templates/cardTemplates.html +++ b/app/templates/cardTemplates.html @@ -18,7 +18,24 @@
Select Argument
- +
@@ -26,7 +43,30 @@
Select Operation
- +
diff --git a/docs/user_guide/templates.md b/docs/user_guide/templates.md index bab30ed48..718624c77 100755 --- a/docs/user_guide/templates.md +++ b/docs/user_guide/templates.md @@ -309,8 +309,8 @@ reference value. === "Episode Airdate" - All airdate reference values must be entered as `YYYY-MM-DD` - e.g. - `2023-12-30`. + All time reference values must be entered as `YYYY-MM-DD` - e.g. + `2023-12-30` for December 30th, 2023. | Operation | Description | Reference Value | | --------: | :---------- | :-------------: | @@ -319,6 +319,16 @@ reference value. | is before | Only apply to Episodes which aired before the given date | :fontawesome-regular-circle-check:{.green} | | is after | Only apply to Episodes which aired after the given date | :fontawesome-regular-circle-check:{.green} | + === "Current Time" + + All time reference values must be entered as `YYYY-MM-DD` - e.g. + `2023-12-30` for December 30th, 2023. + + | Operation | Description | Reference Value | + | --------: | :---------- | :-------------: | + | is before | Only apply before the given date | :fontawesome-regular-circle-check:{.green} | + | is after | Only apply after the given date | :fontawesome-regular-circle-check:{.green} | + === "Episode Extras" | Operation | Description | Reference Value | diff --git a/modules/ref/version_webui b/modules/ref/version_webui index 7e3168e16..430bd643e 100755 --- a/modules/ref/version_webui +++ b/modules/ref/version_webui @@ -1 +1 @@ -v2.0-alpha.13.0-webui145 \ No newline at end of file +v2.0-alpha.13.0-webui146 \ No newline at end of file