|
|
|
@ -113,57 +113,6 @@ else
@@ -113,57 +113,6 @@ else
|
|
|
|
|
$keywords[] = $db->getKeywordTopic($keyword->keywordTopicId)->value; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Scrapes |
|
|
|
|
$localScrape = (object) |
|
|
|
|
[ |
|
|
|
|
'seeders' => 0, |
|
|
|
|
'completed' => 0, |
|
|
|
|
'leechers' => 0, |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
$totalScrape = (object) |
|
|
|
|
[ |
|
|
|
|
'seeders' => 0, |
|
|
|
|
'completed' => 0, |
|
|
|
|
'leechers' => 0, |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
$trackers = []; |
|
|
|
|
|
|
|
|
|
foreach (TRACKER_LINKS as $tracker) |
|
|
|
|
{ |
|
|
|
|
$trackers[] = $tracker->announce; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
foreach ($db->findAddressTrackerByMagnetId($magnet->magnetId) as $magnetToAddressTracker) |
|
|
|
|
{ |
|
|
|
|
if ($addressTracker = $db->getAddressTracker($magnetToAddressTracker->addressTrackerId)) |
|
|
|
|
{ |
|
|
|
|
$scheme = $db->getScheme($addressTracker->schemeId); |
|
|
|
|
$host = $db->getHost($addressTracker->hostId); |
|
|
|
|
$port = $db->getPort($addressTracker->portId); |
|
|
|
|
$uri = $db->getUri($addressTracker->uriId); |
|
|
|
|
|
|
|
|
|
$url = $port->value ? sprintf('%s://%s:%s%s', $scheme->value, |
|
|
|
|
$host->value, |
|
|
|
|
$port->value, |
|
|
|
|
$uri->value) : sprintf('%s://%s%s', $scheme->value, |
|
|
|
|
$host->value, |
|
|
|
|
$uri->value); |
|
|
|
|
|
|
|
|
|
if (in_array($url, $trackers)) |
|
|
|
|
{ |
|
|
|
|
$localScrape->seeders += (int) $magnetToAddressTracker->seeders; |
|
|
|
|
$localScrape->completed += (int) $magnetToAddressTracker->completed; |
|
|
|
|
$localScrape->leechers += (int) $magnetToAddressTracker->leechers; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$totalScrape->seeders += (int) $magnetToAddressTracker->seeders; |
|
|
|
|
$totalScrape->completed += (int) $magnetToAddressTracker->completed; |
|
|
|
|
$totalScrape->leechers += (int) $magnetToAddressTracker->leechers; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$response->magnets[] = (object) |
|
|
|
|
[ |
|
|
|
|
'magnetId' => $magnet->magnetId, |
|
|
|
@ -200,11 +149,9 @@ else
@@ -200,11 +149,9 @@ else
|
|
|
|
|
'read' => $accessRead, |
|
|
|
|
'edit' => $accessEdit, |
|
|
|
|
], |
|
|
|
|
'scrape' => (object) |
|
|
|
|
[ |
|
|
|
|
'local' => $localScrape, |
|
|
|
|
'total' => $totalScrape |
|
|
|
|
] |
|
|
|
|
'seeders' => $db->getMagnetToAddressTrackerSeedersSumByMagnetId($magnet->magnetId), |
|
|
|
|
'completed' => $db->getMagnetToAddressTrackerCompletedSumByMagnetId($magnet->magnetId), |
|
|
|
|
'leechers' => $db->getMagnetToAddressTrackerLeechersSumByMagnetId($magnet->magnetId) |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -335,24 +282,24 @@ echo '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL ?>
@@ -335,24 +282,24 @@ echo '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL ?>
|
|
|
|
|
<?php echo $magnet->timeUpdated ? $magnet->timeUpdated : $magnet->timeAdded ?> |
|
|
|
|
</sup> |
|
|
|
|
</span> |
|
|
|
|
<span class="margin-t-8 margin-r-8 cursor-default opacity-0 parent-hover-opacity-09" title="<?php echo _('Seeders local / total') ?>"> |
|
|
|
|
<span class="margin-t-8 margin-r-8 cursor-default opacity-0 parent-hover-opacity-09" title="<?php echo _('Seeders') ?>"> |
|
|
|
|
<svg class="width-13px" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-up" viewBox="0 0 16 16"> |
|
|
|
|
<path fill-rule="evenodd" d="M8 15a.5.5 0 0 0 .5-.5V2.707l3.146 3.147a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 1 0 .708.708L7.5 2.707V14.5a.5.5 0 0 0 .5.5z"/> |
|
|
|
|
</svg> |
|
|
|
|
<sup><?php echo $magnet->scrape->local->seeders ?> / <?php echo $magnet->scrape->total->seeders ?></sup> |
|
|
|
|
<sup><?php echo $magnet->seeders ?></sup> |
|
|
|
|
</span> |
|
|
|
|
<span class="margin-t-8 margin-r-8 cursor-default opacity-0 parent-hover-opacity-09" title="<?php echo _('Completed local / total') ?>"> |
|
|
|
|
<span class="margin-t-8 margin-r-8 cursor-default opacity-0 parent-hover-opacity-09" title="<?php echo _('Completed') ?>"> |
|
|
|
|
<svg class="width-13px" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-down" viewBox="0 0 16 16"> |
|
|
|
|
<path fill-rule="evenodd" d="M8 1a.5.5 0 0 1 .5.5v11.793l3.146-3.147a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 .708-.708L7.5 13.293V1.5A.5.5 0 0 1 8 1z"/> |
|
|
|
|
</svg> |
|
|
|
|
<sup><?php echo $magnet->scrape->local->completed ?> / <?php echo $magnet->scrape->total->completed ?></sup> |
|
|
|
|
<sup><?php echo $magnet->completed ?></sup> |
|
|
|
|
</span> |
|
|
|
|
<span class="margin-t-8 margin-r-8 cursor-default opacity-0 parent-hover-opacity-09" title="<?php echo _('Leechers local / total') ?>"> |
|
|
|
|
<span class="margin-t-8 margin-r-8 cursor-default opacity-0 parent-hover-opacity-09" title="<?php echo _('Leechers') ?>"> |
|
|
|
|
<svg class="width-13px" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-cup-hot" viewBox="0 0 16 16"> |
|
|
|
|
<path fill-rule="evenodd" d="M.5 6a.5.5 0 0 0-.488.608l1.652 7.434A2.5 2.5 0 0 0 4.104 16h5.792a2.5 2.5 0 0 0 2.44-1.958l.131-.59a3 3 0 0 0 1.3-5.854l.221-.99A.5.5 0 0 0 13.5 6H.5ZM13 12.5a2.01 2.01 0 0 1-.316-.025l.867-3.898A2.001 2.001 0 0 1 13 12.5ZM2.64 13.825 1.123 7h11.754l-1.517 6.825A1.5 1.5 0 0 1 9.896 15H4.104a1.5 1.5 0 0 1-1.464-1.175Z"/> |
|
|
|
|
<path d="m4.4.8-.003.004-.014.019a4.167 4.167 0 0 0-.204.31 2.327 2.327 0 0 0-.141.267c-.026.06-.034.092-.037.103v.004a.593.593 0 0 0 .091.248c.075.133.178.272.308.445l.01.012c.118.158.26.347.37.543.112.2.22.455.22.745 0 .188-.065.368-.119.494a3.31 3.31 0 0 1-.202.388 5.444 5.444 0 0 1-.253.382l-.018.025-.005.008-.002.002A.5.5 0 0 1 3.6 4.2l.003-.004.014-.019a4.149 4.149 0 0 0 .204-.31 2.06 2.06 0 0 0 .141-.267c.026-.06.034-.092.037-.103a.593.593 0 0 0-.09-.252A4.334 4.334 0 0 0 3.6 2.8l-.01-.012a5.099 5.099 0 0 1-.37-.543A1.53 1.53 0 0 1 3 1.5c0-.188.065-.368.119-.494.059-.138.134-.274.202-.388a5.446 5.446 0 0 1 .253-.382l.025-.035A.5.5 0 0 1 4.4.8Zm3 0-.003.004-.014.019a4.167 4.167 0 0 0-.204.31 2.327 2.327 0 0 0-.141.267c-.026.06-.034.092-.037.103v.004a.593.593 0 0 0 .091.248c.075.133.178.272.308.445l.01.012c.118.158.26.347.37.543.112.2.22.455.22.745 0 .188-.065.368-.119.494a3.31 3.31 0 0 1-.202.388 5.444 5.444 0 0 1-.253.382l-.018.025-.005.008-.002.002A.5.5 0 0 1 6.6 4.2l.003-.004.014-.019a4.149 4.149 0 0 0 .204-.31 2.06 2.06 0 0 0 .141-.267c.026-.06.034-.092.037-.103a.593.593 0 0 0-.09-.252A4.334 4.334 0 0 0 6.6 2.8l-.01-.012a5.099 5.099 0 0 1-.37-.543A1.53 1.53 0 0 1 6 1.5c0-.188.065-.368.119-.494.059-.138.134-.274.202-.388a5.446 5.446 0 0 1 .253-.382l.025-.035A.5.5 0 0 1 7.4.8Zm3 0-.003.004-.014.019a4.077 4.077 0 0 0-.204.31 2.337 2.337 0 0 0-.141.267c-.026.06-.034.092-.037.103v.004a.593.593 0 0 0 .091.248c.075.133.178.272.308.445l.01.012c.118.158.26.347.37.543.112.2.22.455.22.745 0 .188-.065.368-.119.494a3.198 3.198 0 0 1-.202.388 5.385 5.385 0 0 1-.252.382l-.019.025-.005.008-.002.002A.5.5 0 0 1 9.6 4.2l.003-.004.014-.019a4.149 4.149 0 0 0 .204-.31 2.06 2.06 0 0 0 .141-.267c.026-.06.034-.092.037-.103a.593.593 0 0 0-.09-.252A4.334 4.334 0 0 0 9.6 2.8l-.01-.012a5.099 5.099 0 0 1-.37-.543A1.53 1.53 0 0 1 9 1.5c0-.188.065-.368.119-.494.059-.138.134-.274.202-.388a5.446 5.446 0 0 1 .253-.382l.025-.035A.5.5 0 0 1 10.4.8Z"/> |
|
|
|
|
</svg> |
|
|
|
|
<sup><?php echo $magnet->scrape->local->leechers ?> / <?php echo $magnet->scrape->total->leechers ?></sup> |
|
|
|
|
<sup><?php echo $magnet->leechers ?></sup> |
|
|
|
|
</span> |
|
|
|
|
<span class="float-right margin-l-12"> |
|
|
|
|
<a href="<?php echo WEBSITE_URL ?>/action.php?target=magnet&toggle=star&magnetId=<?php echo $magnet->magnetId ?>&callback=<?php echo base64_encode(sprintf('%s/index.php?query=%s#magnet-%s', WEBSITE_URL, urlencode($request->query), $magnet->magnetId)) ?>" title="<?php echo _('Star') ?>"> |
|
|
|
|