Update index template to use current HPR db schema

This commit is contained in:
Roan Horning 2022-07-17 21:13:46 -04:00
parent 3f19fea622
commit 30721efcf6
Signed by untrusted user: rho_n
GPG Key ID: 234AEF20B72D5769

View File

@ -21,31 +21,33 @@
<!--% USE DBI(constants.driver, constants.user, constants.password) %--> <!--% USE DBI(constants.driver, constants.user, constants.password) %-->
<!--% FOREACH latest_episodes IN DBI.query(' <!--% FOREACH latest_episodes IN DBI.query('
SELECT SELECT
substr(\'0000\' || Episodes.id, -4, 4) AS [id], substr(\'0000\' || eps.id, -4, 4) AS [id],
CASE Episodes.is_explicit WHEN 1 THEN \'Explicit\' ELSE \'Clean\' END AS is_explicit , CASE eps.explicit WHEN 1 THEN \'Explicit\' ELSE \'Clean\' END AS explicit ,
Episodes.published, Episodes.license, Episodes.title, Episodes.summary, Episodes.series, Episodes.show_notes, eps.date, eps.license, eps.duration,
substr(\'0000\' || Contributors.id, -4, 4) AS [host_id], eps.title, eps.summary, eps.tags,
Contributors.handle, Contributors.email, Contributors.avatar eps.series, eps.notes,
FROM Episodes INNER JOIN Contributors ON Episodes.correspondent_id = Contributors.id CASE hosts.local_image WHEN 1 THEN hosts.hostid ELSE \'hpr_logo\' END AS avatar,
WHERE Episodes.published BETWEEN date(\'now\', \'-7 days\') AND date(\'now\') substr(\'0000\' || hosts.hostid, -4, 4) AS [host_id],
ORDER BY published DESC hosts.host, hosts.email
') FROM eps INNER JOIN hosts ON eps.hostid = hosts.hostid
WHERE eps.date BETWEEN date(\'now\', \'-7 days\') AND date(\'now\')
ORDER BY date DESC ')
%--> %-->
<hr> <hr>
<article> <article>
<header> <header>
<h1><a href="episodes/hpr<!--% latest_episodes.id %-->.html">hpr<!--% latest_episodes.id %--> :: <!--% latest_episodes.title %--></a></h1> <h1><a href="episodes/hpr<!--% latest_episodes.id %-->.html">hpr<!--% latest_episodes.id %--> :: <!--% latest_episodes.title %--></a></h1>
<h3><!--% latest_episodes.description %--></h3> <h3><!--% latest_episodes.summary%--></h3>
<p class="meta"$>hosted by <a href="correspondents/host<!--% latest_episodes.host_id %-->.html"><!--% latest_episodes.handle %--></a> on <!--% latest_episodes.published %--> is flagged as <!--% latest_episodes.is_explicit %--> and released under a <!--% latest_episodes.license %--> license. <br> <p class="meta"$><img src="./images/hosts/<!--% latest_episodes.avatar %-->.png" height="80" width="80" alt="" /></a><br>Hosted by <a href="correspondents/host<!--% latest_episodes.host_id %-->.html"><!--% latest_episodes.host %--></a> on <!--% latest_episodes.date %--> is flagged as <!--% latest_episodes.explicit %--> and released under a <!--% latest_episodes.license %--> license. <br>
<strong>tags:</strong> <em>computer,mobile,bms,power</em>.<br> <strong>Tags:</strong> <!--% latest_episodes.tags %--><em></em>.<br>
<small>listen in <a href="local/hpr<!--% latest_episodes.id %-->.ogg">ogg</a>, <a href="local/hpr<!--% latest_episodes.id %-->.spx">spx</a>, or <a href="local/hpr<!--% latest_episodes.id %-->.mp3">mp3</a> format. <small>listen in <a href="local/hpr<!--% latest_episodes.id %-->.ogg">ogg</a>, <a href="local/hpr<!--% latest_episodes.id %-->.spx">spx</a>, or <a href="local/hpr<!--% latest_episodes.id %-->.mp3">mp3</a> format.
<a href="eps.php?id=3628#comments">comments (0)</a></small> <a href="eps.php?id=3628#comments">comments (0)</a></small>
</p> </p>
</header> </header>
<!--% latest_episodes.show_notes %--> <!--% latest_episodes.notes %-->
<footer> <footer>
<h2>listen now</h2> <h2>listen now</h2>
<p>duration: 00:20:35</p> <p>Duration: <!--% latest_episodes.duration %--></p>
<audio controls preload="none"> <audio controls preload="none">
<source src="local/hpr<!--% latest_episodes.id %-->.ogg" type="audio/ogg" > <source src="local/hpr<!--% latest_episodes.id %-->.ogg" type="audio/ogg" >
<source src="local/hpr<!--% latest_episodes.id %-->.mp3" type="audio/mpeg" > <source src="local/hpr<!--% latest_episodes.id %-->.mp3" type="audio/mpeg" >
@ -65,20 +67,21 @@
</header> </header>
<!--% FOREACH last_5_weeks_episodes IN DBI.query(' <!--% FOREACH last_5_weeks_episodes IN DBI.query('
SELECT SELECT
substr(\'0000\' || Episodes.id, -4, 4) AS [id], substr(\'0000\' || eps.id, -4, 4) AS [id],
CASE Episodes.is_explicit WHEN 1 THEN \'Explicit\' ELSE \'Clean\' END AS is_explicit , CASE eps.explicit WHEN 1 THEN \'Explicit\' ELSE \'Clean\' END AS explicit ,
Episodes.published, Episodes.license, Episodes.title, Episodes.summary, Episodes.series, Episodes.show_notes, eps.date, eps.license, eps.title, eps.summary,
substr(\'0000\' || Contributors.id, -4, 4) AS [host_id], eps.series, eps.duration, eps.notes, eps.tags,
Contributors.handle, Contributors.email, Contributors.avatar substr(\'0000\' || hosts.hostid, -4, 4) AS [hostid],
FROM Episodes INNER JOIN Contributors ON Episodes.correspondent_id = Contributors.id hosts.host, hosts.email, hosts.local_image
WHERE Episodes.published BETWEEN date(\'now\', \'-35 days\') AND date(\'now\', \'-8 days\') FROM eps INNER JOIN hosts ON eps.hostid = hosts.hostid
ORDER BY published DESC WHERE eps.date BETWEEN date(\'now\', \'-35 days\') AND date(\'now\', \'-8 days\')
ORDER BY date DESC
') ')
%--> %-->
<h3 class="title"><a href="episodes/hpr<!--% last_5_weeks_episodes.id %-->.html">hpr<!--% last_5_weeks_episodes.id %--> :: <!--% last_5_weeks_episodes.title %--></a> hosted by <a href="correspondents/host<!--% last_5_weeks_episodes.id %-->.html"><!--% last_5_weeks_episodes.handle %--></a> <h3 class="title"><a href="episodes/hpr<!--% last_5_weeks_episodes.id %-->.html">hpr<!--% last_5_weeks_episodes.id %--> :: <!--% last_5_weeks_episodes.title %--></a> hosted by <a href="correspondents/host<!--% last_5_weeks_episodes.id %-->.html"><!--% last_5_weeks_episodes.host %--></a>
</h3> </h3>
<p class="meta"><strong>Released:</strong> <!--% last_5_weeks_episodes.published %-->. <strong>Duration:</strong> 00:07:14. <strong>Flag:</strong> <!--% last_5_weeks_episodes.is_explicit %-->. <strong>Series:</strong> <a href="series.php?id=11"><!--% last_5_weeks_episodes.series %--></a>. <br> <p class="meta"><strong>Released:</strong> <!--% last_5_weeks_episodes.date %-->. <strong>Duration:</strong> <!--% last_5_weeks_episodes.duration %-->. <strong>Flag:</strong> <!--% last_5_weeks_episodes.explicit %-->. <strong>Series:</strong> <a href="series.php?id=11"><!--% last_5_weeks_episodes.series %--></a>. <br>
<strong>Tags:</strong> <em>nnn, file manager, lightweight apps, vim, zathura, calibre</em>.<br> <strong>Tags:</strong> <em><!--% last_5_weeks_episodes.tags %--></em>.<br>
<!--% last_5_weeks_episodes.summary %--> <!--% last_5_weeks_episodes.summary %-->
</p> </p>
<!--% END %--> <!--% END %-->