Remove nntmux/PreDb class and move its functions into Predb model

This commit is contained in:
DariusIII
2018-01-05 13:11:56 +01:00
parent 5173bc501e
commit 9be1bf4e69
8 changed files with 201 additions and 253 deletions
+2 -3
View File
@@ -2,10 +2,10 @@
namespace nntmux\processing;
use App\Models\Predb;
use nntmux\NZB;
use nntmux\NNTP;
use nntmux\db\DB;
use nntmux\PreDb;
use nntmux\Genres;
use nntmux\Groups;
use nntmux\Category;
@@ -559,7 +559,6 @@ class ProcessReleases
}
if ($collections instanceof \Traversable) {
$preDB = new PreDb(['Echo' => $this->echoCLI, 'Settings' => $this->pdo]);
foreach ($collections as $collection) {
$cleanRelName = utf8_encode(str_replace(['#', '@', '$', '%', '^', '§', '¨', '©', 'Ö'], '', $collection['subject']));
@@ -593,7 +592,7 @@ class ProcessReleases
if ($preID === false && $cleanedName !== '') {
// try to match the cleaned searchname to predb title or filename here
$preMatch = $preDB->matchPre($cleanedName);
$preMatch = Predb::matchPre($cleanedName);
if ($preMatch !== false) {
$cleanedName = $preMatch['title'];
$preID = $preMatch['predb_id'];