mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-03-31 17:15:38 +00:00
order keywords by quantity matches in content
This commit is contained in:
parent
2682666b94
commit
8308ab28f9
2 changed files with 29 additions and 9 deletions
|
|
@ -262,16 +262,26 @@ class TorrentController extends AbstractController
|
|||
|
||||
// Generate keywords by extension
|
||||
$keywords = [];
|
||||
|
||||
foreach ($file->getFileList() as $item)
|
||||
{
|
||||
if ($keyword = pathinfo($item['path'], PATHINFO_EXTENSION))
|
||||
{
|
||||
$keywords[] = mb_strtolower($keyword);
|
||||
$keyword = mb_strtolower($keyword);
|
||||
|
||||
if (isset($keywords[$keyword]))
|
||||
{
|
||||
$keywords[$keyword]++;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$keywords[$keyword] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
$keywords = array_unique($keywords);
|
||||
|
||||
sort($keywords);
|
||||
arsort($keywords);
|
||||
|
||||
// Push torrent
|
||||
$torrents[] =
|
||||
|
|
@ -401,16 +411,26 @@ class TorrentController extends AbstractController
|
|||
|
||||
// Generate keywords by extension
|
||||
$keywords = [];
|
||||
|
||||
foreach ($file->getFileList() as $item)
|
||||
{
|
||||
if ($keyword = pathinfo($item['path'], PATHINFO_EXTENSION))
|
||||
{
|
||||
$keywords[] = mb_strtolower($keyword);
|
||||
$keyword = mb_strtolower($keyword);
|
||||
|
||||
if (isset($keywords[$keyword]))
|
||||
{
|
||||
$keywords[$keyword]++;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$keywords[$keyword] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
$keywords = array_unique($keywords);
|
||||
|
||||
sort($keywords);
|
||||
arsort($keywords);
|
||||
|
||||
// Push torrent
|
||||
$torrents[] =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue