Add the old 2014 query while the new one is not fixed.

This commit is contained in:
Darko
2015-08-13 12:58:36 +02:00
parent fb97d56157
commit 70c8fb6c4f
2 changed files with 15 additions and 10 deletions
+2 -2
View File
@@ -214,8 +214,8 @@ class Enzebe
$this->pdo->queryExec(
sprintf('
UPDATE releases SET nzbstatus = %d %s WHERE id = %d',
\NZB::NZB_ADDED,
($nzb_guid === '' ? '' : ', nzb_guid = ' . $this->pdo->escapestring(md5($nzb_guid))),
NZB::NZB_ADDED,
($nzb_guid === '' ? '' : ', nzb_guid = UNHEX( ' . $this->pdo->escapestring(md5($nzb_guid)) . ' )'),
$relID
)
);
+13 -8
View File
@@ -323,15 +323,20 @@ Class Sharing
}
// Update first time seen.
$this->pdo->queryExec(
sprintf("
UPDATE sharing_sites ss
INNER JOIN release_comments rc ON rc.siteid = ss.site_guid
SET ss.first_time = rc.createddate
WHERE rc.createddate > '2005-01-01'
"
)
$siteTimes = $this->pdo->queryDirect(
'SELECT createddate, siteid FROM release_comments WHERE createddate > \'2005-01-01\' GROUP BY siteid ORDER BY createddate ASC'
);
if ($siteTimes instanceof \Traversable && $siteTimes->rowCount()) {
foreach ($siteTimes as $site) {
$this->pdo->queryExec(
sprintf(
'UPDATE sharing_sites SET first_time = %s WHERE site_guid = %s',
$this->pdo->escapeString($site['createddate']),
$this->pdo->escapeString($site['siteid'])
)
);
}
}
}
/**