[i303] Add comment totals to individual shows on a series page #304

Merged
rho_n merged 2 commits from i303_Add-comment-totals-to-individual-shows-on-a-series-page into main 2025-11-14 02:30:00 +00:00
Showing only changes of commit b2f5322aec - Show all commits

View File

@@ -14,14 +14,24 @@
WHERE miniseries.id = ?
ORDER BY name'
%-->
<!--% query_shows_sql = 'SELECT
<!--% query_shows_sql = 'WITH
comment_tallies AS (
SELECT
eps_id,
COUNT(eps_id) AS eps_tally
FROM comments
GROUP BY eps_id
)
SELECT
id, date, title,
duration, summary, notes,
explicit, eps.license, tags,
hosts.host, hosts.hostid
hosts.host, hosts.hostid,
COALESCE(comment_tallies.eps_tally,0) AS commentsTally
FROM eps
INNER JOIN hosts
ON eps.hostid = hosts.hostid
LEFT JOIN comment_tallies ON eps.id = comment_tallies.eps_id
WHERE series = ? AND eps.date < date(\'now\', \'+1 days\')
ORDER BY eps.id DESC
'