mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-01-31 02:21:36 +00:00
Empty commit
This commit is contained in:
parent
5951e1ac20
commit
01838408b8
@ -53,21 +53,23 @@ public static function update_sphinx_requests($RequestID) {
|
||||
//
|
||||
//In places where the output from this is merged with sphinx filters, it will be in a different order.
|
||||
public static function get_requests($RequestIDs, $Return = true) {
|
||||
// Make sure there's something in $RequestIDs, otherwise the SQL will break
|
||||
if (count($RequestIDs) === 0) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$Found = $NotFound = array_fill_keys($RequestIDs, false);
|
||||
// Try to fetch the requests from the cache first.
|
||||
foreach ($RequestIDs as $RequestID) {
|
||||
foreach ($RequestIDs as $i => $RequestID) {
|
||||
if (!is_number($RequestID)) {
|
||||
unset($RequestIDs[$i], $Found[$GroupID], $NotFound[$GroupID]);
|
||||
continue;
|
||||
}
|
||||
$Data = G::$Cache->get_value("request_$RequestID");
|
||||
if (!empty($Data)) {
|
||||
unset($NotFound[$RequestID]);
|
||||
$Found[$RequestID] = $Data;
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure there's something in $RequestIDs, otherwise the SQL will break
|
||||
if (count($RequestIDs) === 0) {
|
||||
return array();
|
||||
}
|
||||
$IDs = implode(',', array_keys($NotFound));
|
||||
|
||||
/*
|
||||
|
@ -46,23 +46,24 @@ class Torrents {
|
||||
* }
|
||||
*/
|
||||
public static function get_groups($GroupIDs, $Return = true, $GetArtists = true, $Torrents = true) {
|
||||
// Make sure there's something in $GroupIDs, otherwise the SQL
|
||||
// will break
|
||||
if (count($GroupIDs) == 0) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$Found = $NotFound = array_fill_keys($GroupIDs, false);
|
||||
$Key = $Torrents ? 'torrent_group_' : 'torrent_group_light_';
|
||||
|
||||
foreach ($GroupIDs as $GroupID) {
|
||||
foreach ($GroupIDs as $i => $GroupID) {
|
||||
if (!is_number($GroupID)) {
|
||||
unset($GroupIDs[$i], $Found[$GroupID], $NotFound[$GroupID]);
|
||||
continue;
|
||||
}
|
||||
$Data = G::$Cache->get_value($Key.$GroupID, true);
|
||||
if (!empty($Data) && (@$Data['ver'] == CACHE::GROUP_VERSION)) {
|
||||
if (!empty($Data) && $Data['ver'] == CACHE::GROUP_VERSION) {
|
||||
unset($NotFound[$GroupID]);
|
||||
$Found[$GroupID] = $Data['d'];
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure there's something in $GroupIDs, otherwise the SQL will break
|
||||
if (count($GroupIDs) === 0) {
|
||||
return array();
|
||||
}
|
||||
$IDs = implode(',', array_keys($NotFound));
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user