Simplify host episode counting code
Use the database to count the episodes. See https://stackoverflow.com/questions/1656748/how-can-i-fetch-a-single-count-value-from-a-database-with-dbi for explanation of Perl DBI calls.
This commit is contained in:
@@ -3,22 +3,17 @@
|
||||
<!--% PROCESS 'shared-utils.tpl.html' %-->
|
||||
<!--% PROCESS "queries-correspondent.tpl.html" %-->
|
||||
<!--% USE DBI(constants.driver) %-->
|
||||
<!--% results_hpr_shows = DBI.prepare(query_hpr_shows)
|
||||
%-->
|
||||
<!--% results_hpr_shows = DBI.prepare(query_hpr_shows) %-->
|
||||
<!--% results_hpr_show_count = DBI.prepare(query_hpr_show_count) %-->
|
||||
<!--% hpr_shows_to_count = results_hpr_show_count.execute(id); %-->
|
||||
<!--% hpr_result_status = results_hpr_show_count.execute(id); %-->
|
||||
<!--% hpr_shows = results_hpr_shows.execute(id); %-->
|
||||
<!--% hpr_show_count = 0 %-->
|
||||
<!--% FOREACH show IN hpr_shows_to_count %-->
|
||||
<!--% hpr_show_count = hpr_show_count +1; %-->
|
||||
<!--% END %-->
|
||||
<!--% hpr_show_count = results_hpr_show_count.fetchrow_array %-->
|
||||
|
||||
<!--% twt_shows_to_count = query_twt_show_count.execute(id); %-->
|
||||
<!--% twt_shows = query_twt_shows.execute(id); %-->
|
||||
<!--% twt_show_count = 0 %-->
|
||||
<!--% FOREACH show IN twt_shows_to_count %-->
|
||||
<!--% twt_show_count = twt_show_count +1; %-->
|
||||
<!--% END %-->
|
||||
<!--% results_hpr_shows = DBI.prepare(query_twt_shows) %-->
|
||||
<!--% results_twt_show_count = DBI.prepare(query_twt_show_count) %-->
|
||||
<!--% twt_result_status = results_twt_show_count.execute(id); %-->
|
||||
<!--% twt_shows = results_hpr_shows.execute(id); %-->
|
||||
<!--% twt_show_count = results_twt_show_count.fetchrow_array %-->
|
||||
|
||||
<!--% hosts = DBI.tie('hosts', 'hostid') %-->
|
||||
|
||||
|
||||
Reference in New Issue
Block a user