Hide display of future shows on series listings page

This commit is contained in:
Roan Horning 2023-02-24 23:35:18 -05:00
parent f7e54233e2
commit 4a34496f24
Signed by untrusted user: rho_n
GPG Key ID: 234AEF20B72D5769
3 changed files with 32 additions and 14 deletions

View File

@ -1,21 +1,9 @@
<!--% PROCESS 'shared-utils.tpl.html' %--> <!--% PROCESS 'shared-utils.tpl.html' %-->
<!--% PROCESS "queries-series-${constants.database}.tpl.html" %-->
<article> <article>
<!--% USE DBI(constants.driver, constants.user, constants.password) %--> <!--% USE DBI(constants.driver, constants.user, constants.password) %-->
<h1 class="title">In-Depth Series</h1> <h1 class="title">In-Depth Series</h1>
<!--% FOREACH series IN DBI.query( <!--% FOREACH series IN DBI.query(query_episodes) %-->
'SELECT miniseries.id, miniseries.name, miniseries.description,
miniseries.private, miniseries.image, miniseries.valid,
ep.number_of_episodes, ep.latest_show, ep.earliest_show
FROM miniseries
INNER JOIN
(SELECT series,
COUNT(eps.id) AS number_of_episodes,
MAX(eps.date) AS latest_show,
MIN(eps.date) AS earliest_show
FROM eps
GROUP BY series) AS ep ON ep.series = miniseries.id
ORDER BY name'
) %-->
<h2><a href="<!--% absolute_path(baseurl) %-->series/<!--% zero_pad_left(series.id) %-->.html"><!--% series.name %--></a></h2> <h2><a href="<!--% absolute_path(baseurl) %-->series/<!--% zero_pad_left(series.id) %-->.html"><!--% series.name %--></a></h2>
<ul> <ul>
<li>Number of episodes: <!--% series.number_of_episodes %--></li> <li>Number of episodes: <!--% series.number_of_episodes %--></li>

View File

@ -0,0 +1,15 @@
<!--% query_episodes = 'SELECT miniseries.id, miniseries.name, miniseries.description,
miniseries.private, miniseries.image, miniseries.valid,
ep.number_of_episodes, ep.latest_show, ep.earliest_show
FROM miniseries
INNER JOIN
(SELECT series,
COUNT(eps.id) AS number_of_episodes,
MAX(eps.date) AS latest_show,
MIN(eps.date) AS earliest_show
FROM eps
WHERE eps.date < DATE_ADD(NOW(), INTERVAL 1 DAY)
GROUP BY series) AS ep ON ep.series = miniseries.id
ORDER BY name'
%-->

View File

@ -0,0 +1,15 @@
<!--% query_episodes = 'SELECT miniseries.id, miniseries.name, miniseries.description,
miniseries.private, miniseries.image, miniseries.valid,
ep.number_of_episodes, ep.latest_show, ep.earliest_show
FROM miniseries
INNER JOIN
(SELECT series,
COUNT(eps.id) AS number_of_episodes,
MAX(eps.date) AS latest_show,
MIN(eps.date) AS earliest_show
FROM eps
WHERE eps.date < date(\'now\', \'+1 days\')
GROUP BY series) AS ep ON ep.series = miniseries.id
ORDER BY name'
%-->