We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit ed2d9662 authored by clint's avatar clint

don't rerun the query if the page is cached

parent 56ff34df
......@@ -19,23 +19,25 @@
*/
require_once('../../database.php');
require_once('../../templating.php');
require_once('../../data/sanitize.php');
require_once($install_path . '/database.php');
require_once($install_path . '/templating.php');
require_once($install_path . '/data/sanitize.php');
$res = $mdb2->query("SELECT t.id, t.artist, t.album, t.name, t.mbid as tmbid, st.mbid as stmbid FROM Scrobble_Track st JOIN Track t ON lower(t.name)=st.name AND lower(t.album)=st.album AND lower(t.artist)=st.artist AND t.mbid<>st.mbid");
$smarty->caching = 2;
$smarty->cache_lifetime = 43200;
$aEntries = array();
$i = 0;
if(!$smarty->is_cached('mbid-mismatch-report.tpl')) {
$res = $mdb2->query("SELECT t.id, t.artist, t.album, t.name, t.mbid as tmbid, st.mbid as stmbid FROM Scrobble_Track st JOIN Track t ON lower(t.name)=st.name AND lower(t.album)=st.album AND lower(t.artist)=st.artist AND t.mbid<>st.mbid");
while (($row = $res->fetchRow(MDB2_FETCHMODE_ASSOC))) {
$trow = sanitize($row);
$aEntries[$i++] = $trow;
}
$aEntries = array();
$i = 0;
$smarty->assign("entries", $aEntries);
while (($row = $res->fetchRow(MDB2_FETCHMODE_ASSOC))) {
$trow = sanitize($row);
$aEntries[$i++] = $trow;
}
$smarty->assign("entries", $aEntries);
}
$smarty->caching = 2;
$smarty->cache_lifetime = 43200;
$smarty->display("mbid-mismatch-report.tpl");
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment