Fixes in db.sql and added a patch.

This commit is contained in:
Darko
2014-05-28 08:57:06 +02:00
parent 744230d696
commit 2a90145ef3
4 changed files with 10 additions and 7 deletions
+2 -4
View File
@@ -52,7 +52,7 @@ CREATE TABLE prehash (
AUTO_INCREMENT =1;
CREATE INDEX `ix_prehash_filename` ON `prehash` (`filename`);
CREATE INDEX `ix_prehash_title` ON `prehash` (`title`);
CREATE UNIQUE INDEX `ix_prehash_title` ON `prehash` (`title`);
CREATE INDEX `ix_prehash_nfo` ON `prehash` (`nfo`);
CREATE INDEX `ix_prehash_predate` ON `prehash` (`predate`);
CREATE INDEX `ix_prehash_source` ON `prehash` (`source`);
@@ -60,8 +60,6 @@ CREATE INDEX `ix_prehash_requestid` ON `prehash` (`requestID`, `groupID`);
CREATE INDEX `ix_prehash_size` ON `prehash` (`size`);
CREATE INDEX `ix_prehash_category` ON `prehash` (`category`);
CREATE INDEX `ix_prehash_searched` ON `prehash` (`searched`);
CREATE UNIQUE INDEX `ix_prehash_md5` ON `prehash` (`md5`);
CREATE UNIQUE INDEX `ix_prehash_sha1` ON `prehash` (`sha1`);
DROP TABLE IF EXISTS tmux;
CREATE TABLE tmux (
@@ -205,7 +203,7 @@ INSERT INTO tmux (setting, value) VALUES ('defrag_cache', '900'),
('ffmpeg_duration', '5'),
('ffmpeg_image_time', '5'),
('processvideos', '0'),
('sqlpatch', '43');
('sqlpatch', '45');
DROP TABLE IF EXISTS releasesearch;
CREATE TABLE releasesearch (
+3
View File
@@ -0,0 +1,3 @@
ALTER TABLE prehash DROP INDEX ix_prehash_title;
ALTER IGNORE TABLE prehash ADD UNIQUE INDEX ix_prehash_title (title);
UPDATE `tmux` SET value = '45' WHERE `setting` = 'sqlpatch';
+4 -2
View File
@@ -382,7 +382,6 @@ class Namefixer
$this->category = new Category();
$this->functions = new Functions();
$this->matched = false;
//Remove all non-printable chars, preg match all interesting words
$titlelike = "%" . $this->functions->stripNonPrintingChars($pre['title']) . "%";
preg_match_all('#\w+#', $pre['title'], $matches, PREG_PATTERN_ORDER);
@@ -392,7 +391,9 @@ class Namefixer
$res = $db->queryDirect(sprintf("SELECT rs.releaseID AS releaseID FROM releasesearch rs
WHERE MATCH (rs.name, rs.searchname) AGAINST ('%s' IN BOOLEAN MODE)
AND (rs.name LIKE %s OR rs.searchname LIKE %s)
LIMIT 16", $titlematch, $db->escapeString($titlelike), $db->escapeString($titlelike)));
LIMIT 16", $titlematch, $db->escapeString($titlelike), $db->escapeString($titlelike)
)
);
if ($res !== false) {
$total = count($res);
@@ -434,6 +435,7 @@ class Namefixer
} elseif ($total >= 10) {
$matching = -1;
}
return $matching;
}
+1 -1
View File
@@ -15,7 +15,7 @@ $tmux = $t->get();
$patch = (isset($tmux->sqlpatch)) ? $tmux->sqlpatch : 0;
// Check database patch version
if ($patch < 44) {
if ($patch < 45) {
exit($c->error("\nYour database is not up to date. Please update.\nphp ${DIR}/lib/DB/patchDB.php\n"));
}
$tmux_session = (isset($tmux->tmux_session)) ? $tmux->tmux_session : 0;