mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 09:18:54 +00:00
21 lines
718 B
PHP
21 lines
718 B
PHP
<?php
|
|
require_once realpath(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'indexer.php');
|
|
|
|
|
|
$db = new \newznab\db\Settings();
|
|
|
|
//query to find rough matches
|
|
$rows = $db->query("SELECT ID, searchname from releases where searchname like '%QWERTY%'");
|
|
|
|
//loop around them applying some ham fisted regex
|
|
foreach ($rows as $row)
|
|
{
|
|
$reg = '/^(\[QWERTY\] ")(?P<name>.*?(xvid|x264)\-.*?)"/i';
|
|
preg_match($reg, $row["searchname"], $matches);
|
|
if (isset($matches["name"])) {
|
|
$db->exec(sprintf("update releases set searchname = %s, name = %s where ID = %d",
|
|
$db->escapeString($matches["name"]), $db->escapeString($matches["name"]), $row["id"]));
|
|
echo $matches["name"]."\n";
|
|
}
|
|
}
|